Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a requirement , if user selects lets say 3 months , expression should compare sales with prev 3 months and display the output with up or down image depending on if sales r going up or down. as per my understanding we should first get current selection result in variable and then compare it with previous selection . I'm somehow not able to put my logic in set analysis . any help would be helpful!
vCurrentSelection=if({$<Date = '$(vFromMonth)'>} and {$<Date = '$(vToMonth)'>}sum(sales)
You may do it with three expressions, first expression is simple Sum(Sales) based on current selection, second expression to find sum for previous quarter -
Sum({<Date = {">=MonthStart(Date(YourDate,yourdateformat),-6)<=MonthEnd(Date(YourDate,yourdateformat),-3)"}>}) (you may need to correct the syntax here)
Third expression can show image based on values of first two expressions. You can use labels of first two expressions in third one to compare values using simple if statement.
Follow this