Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a expression :
=if(PeriodOp='Quarter',Sum({<Quarter={$(vPriorQuarter)}>} O_TriGiaBan),if(PeriodOp='Month',Sum({<Month={$(vPriorMonth)}>} O_TriGiaBan),If(PeriodOp='Week',Sum({<WeekYear={$(vPriorWeek)}>} O_TriGiaBan))))
I wanna reduce IF expression and replace expression as follow :
=Sum({<Quarter={$(vPriorQuarter)} , Month={$(vPriorMonth)} , WeekYear={$(vPriorWeek)} >} O_TriGiaBan)
It dont work.. Quarter, Month, Week are selection...Please help me...!
Try changing the definiation of your variables to these:
vPriorQuarter = If(PeriodOp = 'Quarter', yourCurrentExpression, '*')
vPriorMonth = If(PeriodOp = 'Month', yourCurrentExpression, '*')
vPriorWeek = If(PeriodOp = 'Week', yourCurrentExpression, '*')
and then use this expression and see if it works:
=Sum({<Quarter={$(vPriorQuarter)} , Month={$(vPriorMonth)} , WeekYear={$(vPriorWeek)} >} O_TriGiaBan)
Try this =Sum({$<Quarter={$(vPriorQuarter)} , Month={$(vPriorMonth)} , WeekYear={$(vPriorWeek)} >} O_TriGiaBan)
Try changing the definiation of your variables to these:
vPriorQuarter = If(PeriodOp = 'Quarter', yourCurrentExpression, '*')
vPriorMonth = If(PeriodOp = 'Month', yourCurrentExpression, '*')
vPriorWeek = If(PeriodOp = 'Week', yourCurrentExpression, '*')
and then use this expression and see if it works:
=Sum({<Quarter={$(vPriorQuarter)} , Month={$(vPriorMonth)} , WeekYear={$(vPriorWeek)} >} O_TriGiaBan)
It dont work @Gowtham
You might need double quotes like this:
=Sum({<Quarter={"$(vPriorQuarter)"} , Month={"$(vPriorMonth)"} , WeekYear={"$(vPriorWeek)"} >} O_TriGiaBan)
=Sum({<Quarter={$(vPriorQuarter)} , Month={$(vPriorMonth)} , WeekYear={$(vPriorWeek)} >} O_TriGiaBan)
and
=Sum({<Quarter={"$(vPriorQuarter)"} , Month={"$(vPriorMonth)"} , WeekYear={"$(vPriorWeek)"} >} O_TriGiaBan)
are correct, too .
Thank you so much @Sunny T
Hi sunindia , Can you please make me understand clearly about this code :
vPriorQuarter = If(PeriodOp = 'Quarter', yourCurrentExpression, '*')
and when I remove '*' , this code cant work ?
This code just mean that when PeriodOp is not equal to 'Quarter' then use *. and * in set analysis means select everything.
I hope that makes sense.
Best,
Sunny