Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
arusanah
Creator II
Creator II

help with set analysis

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)

2 Replies
Digvijay_Singh

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.

sujeetsingh
Master III
Master III

Follow this

Dates in Set Analysis