Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

Please kindly assist in writing the set analysis

Hi Folks ,

Please kindly assist me in writing the below set analysis .

sum({<bank={'Wesbank'},month={">=$(=Month(Today()))<=$(=month(AddMonths(today(),-1)))"}> } DISTINCT if(LatestForPodium ='1' and LatestForState ='1',dicAmount))

I have tried using variable as vCurrentMonth as month(today())

and vPreviousMonth as month(AddMonths(today(),-1))

When I am using this two variable , I tried the below expression -

sum({<bank={'Wesbank'},month={'$(vCurrentMonth)','$(vPreviousMonth)'}> }if(LatestForPodium ='1' or LatestForState ='1',dicAmount))

The sum is not calculating when I am putting the month condition . The months should check current and previous month.

Thanks,

5 Replies
sunny_talwar

How is your month field created in the script?

sunny_talwar

Also, did you mean this?

Sum({<bank = {'Wesbank'}, month = {">=$(=Month(AddMonths(Today(), -1)))<=$(=Month(Today()))"}>} DISTINCT if(LatestForPodium = '1' and LatestForState = '1', dicAmount))

Or this

Sum({<bank = {'Wesbank'}, month = {">=$(=Month(AddMonths(Today(), -1)))<=$(=Month(Today()))"}, LatestForPodium = {1}, LatestForState = {1}>} DISTINCT dicAmount)

suvechha_b
Creator III
Creator III
Author

Month(date_updated) as month

sunny_talwar

Try the expressions above and see if they work

avkeep01
Partner - Specialist
Partner - Specialist

Maybe adding a space between the months (and switch the start vprev month with the current month. So bigger then last month and equal to current month. Just like stalwar1‌ mentioned.

sum({<bank={"Wesbank"},month={">=$(=month(AddMonths(today(),-1))) <=$(=Month(Today()))"}> } DISTINCT if(LatestForPodium ='1' and LatestForState ='1',dicAmount))