Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I tried looking the community, but couldn't find a suitable way to actually use set analysis for multiple IF statements.
I have a scenario for calculating based on conditions like min max and average based on some selections. Is that possible to bring inside a set rather than using this nested loop as it is making my App terribly slow.
-
=if(vMinMax='MAX' and vTemperature='TEMPERATURE' ,Round(((max({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))-32)*0.5556),
if(vMinMax='MIN' and vTemperature='TEMPERATURE' ,Round(((avg({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))-32) * 0.5556),
if(vMinMax='MAX', Round(max({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value)),
if(vMinMax='AVG' and vTemperature='TEMPERATURE' and vTem=1 ,Round(((avg({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))-32) * 0.5556),
Round(avg({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))
)
)
)
)
))
vMinMax= getfieldselections(field)
vTemperature= getfieldselections (weather)
Any Help is appreciated:)
Set analysis is only for comparing actual fields, not variable values and it does not appear that your fields are meant to be associated to your data
You can at best replace this with Pick(Match(
=Pick(Match(vMinMax&vTemperature&vTem
,'MAXTEMPERATURE','MINTEMPERATURE','MAX','AVGTEMPERATURE1')+1
,Round(avg({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value)) // alternate
,Round(((max({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))-32)*0.5556) // vMinMax='MAX' and vTemperature='TEMPERATURE' and vTem is null
,Round(((avg({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))-32) * 0.5556) //vMinMax='MIN' and vTemperature='TEMPERATURE' and vTem is null
,Round(max({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value)) // vMinMax='MAX' and vTemperature is null and vTem is null
,Round(((avg({< date_x ={">=$(vStartDate)<=$(vEndDate)"}>}value))-32) * 0.5556) // vMinMax='AVG' and vTemperature='TEMPERATURE' and vTem=1
)