Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
we are having around 100 different expressions similar to type 1 mentioned below. Having "IF" condition is decreasing performance. Can you please suggest some simple expression to get requirement.
we have two buttons, Next Quarter and Next Four Quarters. Based on user click it should calculate.
I am thinking ways to further reduce Type 2 to single expression something like
Sum({<QuarterYear={$(vNextQuarter)} + (vNext4QuartersButton * {$(vNextQuarter1), $(vNextQuarter2), $(vNextQuarter3)})>} Spend)
====================================================================================================
Type:1
-----------
if($(vNext4QuartersButton)=0,
Sum({<QuarterYear={$(vNextQuarter)}>} Spend)
,
Sum({<QuarterYear={$(vNextQuarter), $(vNextQuarter1), $(vNextQuarter2), $(vNextQuarter3)}>} Spend) )
====================================================================================================
Type:2
-----------
Sum({<QuarterYear={$(vNextQuarter)}>} Spend)
+
(vNext4QuartersButton * Sum({<QuarterYear={$(vNextQuarter1), $(vNextQuarter2), $(vNextQuarter3)}>} Spend))
====================================================================================================
I created a variable and passing the quarters flag to it when button is clicked. I did some performance analysis and found this is the only better solution without using IF condition.
=Sum({<QFlag = {$(vTP)}>} [Benchmark Savings])
For more information about creating the Flag, refer below document.
Regards,
Sai Krishna,
Using the pick & match functions can seriously improve functionallity over IF statements, take a look at those (search on here)
Thank You. is there any way to write in single expressions like below?
Sum({<QuarterYear={$(vNextQuarter)} + (vNext4QuartersButton * {$(vNextQuarter1), $(vNextQuarter2), $(vNextQuarter3)})>} Spend)
I created a variable and passing the quarters flag to it when button is clicked. I did some performance analysis and found this is the only better solution without using IF condition.
=Sum({<QFlag = {$(vTP)}>} [Benchmark Savings])
For more information about creating the Flag, refer below document.
Regards,
Sai Krishna,