Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a list box which has Years and Quarters in it.I have defined a group Year_Quarter in Settings -> Document Properties -> Group and then I have made a list box from it.
My aim is to get YOY difference for sales amount.
In the Year_Quarter list box I select a Year but may or may not select quarter.So when I don't select a quarter I want difference between the year selected and its previous year.
If I select a quarter then I want difference between selected (year quarter ) and previous (year quarter)
For example if I select Q12018 then I want difference with Q12017
But If I select only 2018 and dont select any quarter then I want difference with entire 2017
I wrote a set expression as follows for calculating difference
=sum({<Financial_Year = {'$(Selected_Year)'}, Quarter = {'$(Selected_Quarter)'}>} AMOUNT) - sum({<Financial_Year = {'$(Previous_Year)'}, Quarter = {'$(Selected_Quarter)'}>} AMOUNT)
Where
Selected_Year = GetFieldSelections(Financial_Year)
Selected_Quarter = GetFieldSelections(Quarter)
Previous_Year = GetFieldSelections(Financial_Year) -1
The problem in the above expression that it needs to be selected as well.How can I edit the above expression such that take Quarter only if .I have selected quarter else dont use quarter value just use year value
Hi Nishant,
You've already tried an 'if' statement ?
Example:
if (GetSelectedCount (Quarter) > 0, expression to calculate the quarter, expression without considering the quarter)
I do not know if this helps ?
Hi Nishant,
You've already tried an 'if' statement ?
Example:
if (GetSelectedCount (Quarter) > 0, expression to calculate the quarter, expression without considering the quarter)
I do not know if this helps ?
Thanks It works as expected
Not quite clear, but it looks like you do not need to put Quarter = {'$(Selected_Quarter)'} in set analysis