Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Syahfira1
Contributor III
Contributor III

Top 10 Variance Amount

Hello,

How I can create  set analysis to get the top 10 Variance amount which is subtraction of current amount withh previous amount?

This is my formula to get the variance amount between current and previous month.

sum({<[Reporting Date.MasterCalendar.Date] = {"$(=vLatestDate)"}>}"Past Due")
-
sum({<[Reporting Date.MasterCalendar.Date]={"$(=date(addmonths(vLatestDate,-1,1)))"}>}"Past Due")

 

This is my formula to find the top 10 variance by Country

sum({$<[Country]={"=rank(sum({<[Reporting Date.MasterCalendar.Date] = {"$(=vLatestDate)"}>}"Past Due")
-
sum({<[Reporting Date.MasterCalendar.Date]={"$(=date(addmonths(vLatestDate,-1,1)))"}>}"Past Due"),4,1) <= $(vTop)"}>} [Invoice Amount USD])

But my top 10 formula is not working when I put the inner set analysis. How I can put subtraction calculation in nested set analysis?

Help is much appreciated.

 

 

Labels (1)
4 Replies
ajaykakkar93
Specialist III
Specialist III

hi,
below is the sample code

rank(

sum({<[Reporting Date.MasterCalendar.Date] = {"$(=vLatestDate)"}>}"Past Due")
-
sum({<[Reporting Date.MasterCalendar.Date]={"$(=date(addmonths(vLatestDate,-1,1)))"}>}"Past Due")

,4)

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Syahfira1
Contributor III
Contributor III
Author

Hi Ajay, 

May I know what I should put for the Step 3?

Should I replace it with subtraction set analysis?

But, it didnt work.

 

Syahfira1
Contributor III
Contributor III
Author

@sunny_talwar  can you help me on this please? would appreciate it so much 🌻

ajaykakkar93
Specialist III
Specialist III


rank(

sum({<[Reporting Date.MasterCalendar.Date] = {"$(=vLatestDate)"}>}"Past Due")
-
sum({<[Reporting Date.MasterCalendar.Date]={"$(=date(addmonths(vLatestDate,-1,1)))"}>}"Past Due")

,4)


just add it in separate measure & look at the rank if it is coming as you needed accordingly 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting