Hi @Moataz_Imad ,
Generally I use a second collection, simply leaving the first intact for subsequent iterations, however that is not the issue here. I have now looked at it again and there is a shorter way as your Lookups do not relate to a collection field, so you can "pre-calculate" these, with one being a simple number and the second a Table of numbers. You can also include the first data set without doing a collection
With(
{
wEq,
AddColumns(
ShowColumns(
EQ_Parameters,
"Equipment"
),
"Jan",
0,
"Feb",
0,
"Mar",
0,
"Apr",
0,
"May",
0,
"Jun",
0,
"Jul",
0,
"Aug",
0,
"Sep",
0,
"Oct",
0,
"Nov",
0,
"Dec",
0
)
},
With(
{
wKW:
LookUp(
EQ_Parameters,
Equipment = "Primary pumps"
).Rated_kW,
wMonth:
LookUp(
Month_Est,
Parm = "Days in Month"
)
},
ClearCollect(
Eq_cons,
ForAll(
wEq As aCol,
{
Equipment: aCol.Equipment,
Jan: wKW * wMonth.Jan,
Feb: wKW * wMonth.Feb,
Mar: wKW * wMonth.Mar,
Apr: wKW * wMonth.Apr,
May: wKW * wMonth.May,
Jun: wKW * wMonth.Jun,
Jul: wKW * wMonth.Jul,
Aug: wKW * wMonth.Aug,
Sep: wKW * wMonth.Sep,
Oct: wKW * wMonth.Oct,
Nov: wKW * wMonth.Nov,
Dec: wKW * wMonth.Dec
}
)
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps