Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mohdhaniff
Creator
Creator

Camparing Current Month(Max Date) and Past 2 Months

Hi.

I want to compare ETP Amount collected for the maximum (current) month with Previous and 2 Month Before.

For current Month, I already got the expression as below:

          sum({$<[Date Disbursed - Month]={'$(=max([Date Disbursed - Month]))'}>} [ETP Amount])

How can I get the value for Previous Month and Past 2 Month in expression?

My [Date Disbursed - Month] formatted as 'DD-MMM-YYYY'.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps the date format of that field differs from the document default. Try adding a date format:

sum({$<[Date Disbursed - Month]={'$(=Date(AddMonths(max([Date Disbursed - Month]),-1),'DD-MMM-YYYY'))'}>} [ETP Amount])


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

Previous month: sum({$<[Date Disbursed - Month]={'$(=AddMonths(max([Date Disbursed - Month]),-1))'}>} [ETP Amount])

2 Months before: sum({$<[Date Disbursed - Month]={'$(=AddMonths(max([Date Disbursed - Month]),-2))'}>} [ETP Amount])


talk is cheap, supply exceeds demand
mohdhaniff
Creator
Creator
Author

Thanks Gysbert,

I already try solution given but  results = 0

aa.GIF

Gysbert_Wassenaar

Perhaps the date format of that field differs from the document default. Try adding a date format:

sum({$<[Date Disbursed - Month]={'$(=Date(AddMonths(max([Date Disbursed - Month]),-1),'DD-MMM-YYYY'))'}>} [ETP Amount])


talk is cheap, supply exceeds demand
mohdhaniff
Creator
Creator
Author

Thanks gysbert.

Earlier I thought something wrong with the formula due to red line. Today I learn something new about QlikView trick.

aa.GIF

*P/S, If you don't mind, can you help me on another issue related to this solution?

Comparing Total Collected between 2 month within the same period

For this query, I wish to do set analysis to compare amount collected for current month and previous month (or previous 2 month). The different is I want to know how much amount collected on previous month within the same period collected on current month.

e.g.: Current month number of days is 4, then how much collected for the same period on previous month.

Gysbert_Wassenaar

Yes, you're nesting single quotes within single quotes. Replace the outer single quotes with double quotes and the editor will be happy.


talk is cheap, supply exceeds demand
mohdhaniff
Creator
Creator
Author

Thanks..