Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
breezy1234
Contributor
Contributor

Set Analysis not returning value

I want to know how much a sales person rebate is MoM.

Sum({$<[Rebate Month] ={"$(=Max(Rebate Month)-1)"}>} [Total kW]) is my code and nothing is returning. What is the reason? Am I missing the Sales in the expression?

breezy1234_1-1692826531255.png

 

breezy1234_0-1692826355409.png

 

4 Replies
Digvijay_Singh

Your 'Rebate Month' is a text field, Max function won't work with the text field. The better way to have Month-Year field in your data model and you would need Monthend(Monthyearfield,-1) to go to the previous month.

Can you share small sample of your data or a sample app so that someone can provide more help.

breezy1234
Contributor
Contributor
Author

Sounds like I will have to add the Month and year through the data load editor? Is this screenshot better?

breezy1234_0-1692828558980.png

 

Digvijay_Singh

Something like this - 

Load *,Date(Monthend(Date),'MMM-YYYY') as [Month Year]
inline [
Date, Sales
01/01/2023, 100
01/20/2023, 100
02/05/2023, 150
03/05/2023, 150
04/05/2023, 150
05/05/2023, 150
06/05/2023, 150
07/05/2023, 150
07/15/2023, 1000
07/20/2023, 200
08/10/2023, 2000
];

KPI Expression - 

Sum({<[Month Year]={'$(=Date(Monthend(Max([Month Year]),-1),'MMM-YYYY'))'}>}Sales)

Digvijay_Singh_0-1692849147192.png

 

 

 

breezy1234
Contributor
Contributor
Author

Looks like it works but I might've done it wrong?

breezy1234_0-1692893385739.pngbreezy1234_1-1692893403474.png