@RandyHayes has been awesome in helping me get this partially fixed now I am struggling with the next part.
I have a parent gallery and a nested gallery. In the nested gallery I have several categories that I need to sum in total no matter the date in the nested gallery.
@RandyHayes helped me to get the switch that allows the gallery to sum based on the any definition I want, however I am stuck on how to get the Program today sum by category.
Here is the switch code
Switch(ThisItem.Category,
"Codes",Sum(ThisItem.Codes,Value),
"Safety",Sum (ThisItem.Safety, Value),
"BluePrints", Sum (ThisItem.BluePrints, Value),
"Wiring Equip", Sum(ThisItem.WiringEqup, Value),
"Install Substation Equip", Sum(ThisItem.InstallSubEquip, Value),
"Install Disp Equipment",Sum (ThisItem.InstallDispEquip, Value),
"Install Motors Generators", Sum(ThisItem.InstallMotorGen, Value),
"Shop Work Elect Equip", Sum(ThisItem.ShopWkElecEq, Value),
"Pwr Wiring Bus Bar Install", Sum(ThisItem.PwrWiringBusBar, Value),
"Welding",Sum (ThisItem.Welding, Value),
"OJT Meter Relay Tech", Sum(ThisItem.OJTMeterRelay,Value),
"OJT Lineman", Sum(ThisItem.OJTLineMan, Value),
"OJT Dist Dispatcher", Sum(ThisItem.OJTDisp, Value),
"OJT Sr System Operator", Sum(ThisItem.OJTSRSysOp, Value),
"RSI-Supvd", Sum(ThisItem.RSISupvd, Value),
"RSI-UnSupvd", Sum(ThisItem.RSIUnSupvd, Value),
0
)
Here is an image of the Parent and nested gallery
What I am trying to do is in the Left in Category all years should be the same regardless of quarter or year, it is the sum of the program by category.
Here is the code on the Parent Gallery
Sort(
GroupBy(
Filter(
'POWER SYSTEM ELECTRICIAN Work Hours',
'Apprentice Name' = Upper(varCurrentUserFullName),
'Year Entered' >= 2020,
(IsBlank(Dropdown2.Selected.Result) || 'Year Entered' = Dropdown2.Selected.Result || 'Year Entered' = Dropdown2.Selected.Result)
),
"QTR",
"_data"
),
QTR,
Ascending
)
and here is the code for the nested
With(
{
_data: AddColumns(ThisItem._data, "QTRS", ThisItem.QTR),
_categories: With(
{
_ex: LookUp(
'Apprentice List',
'Apprentice Email'.DisplayName = varCurrentUserFullName,
true
)
},
Filter(
Categories,
'Category Type' = "Power System Electrician"
)
)
},
ForAll(
_categories As _category,
Patch(
_category,
{
Codes: ForAll(
_data,
{
'Year Entered': Years,
Value: Code
}
),
Safety: ForAll(
_data,
{
'Year Entered': Years,
Value: Safety
}
),
BluePrints: ForAll(
_data,
{
'Year Entered': Years,
Value: Blueprints
}
),
WiringEqup: ForAll(
_data,
{
'Year Entered': Years,
Value: 'Wiring Equip'
}
),
InstallSubEquip: ForAll(
_data,
{
'Year Entered': Years,
Value: 'Install Substation Equip'
}
),
InstallDispEquip: ForAll(
_data,
{
'Year Entered': Years,
Value: 'Wiring Equip'
}
),
InstallMotorGen: ForAll(
_data,
{
'Year Entered': Years,
Value: 'Install Motors Generators'
}
),
ShopWkElecEq: ForAll(
_data,
{
'Year Entered': Years,
Value: 'Shop Work Elect Equip'
}
),
PwrWiringBusBar: ForAll(
_data,
{
'Year Entered': Years,
Value: 'Pwr Wiring Bus Bar Install'
}
),
Welding: ForAll(
_data,
{
'Year Entered': Years,
Value: Welding
}
),
OJTMeterRelay: ForAll(
_data,
{
'Year Entered': Years,
Value: 'OJT Meter Relay Tech'
}
),
OJTLineMan: ForAll(
_data,
{
'Year Entered': Years,
Value: 'OJT Lineman'
}
),
OJTDisp: ForAll(
_data,
{
'Year Entered': Years,
Value: 'OJT Dispatch'
}
),
OJTSRSysOp: ForAll(
_data,
{
'Year Entered': Years,
Value: 'OJT Sr System Oper.'
}
),
RSISupvd: ForAll(
_data,
{
'Year Entered': Years,
Value: 'RSI-Supvd'
}
),
RSIUnSupvd: ForAll(
_data,
{
'Year Entered': Years,
Value: 'RSI-UnSupvd'
}
)
}
)
)
)
This is all working as expected except the last column I could really use some help on this!

Report
All responses (
Answers (