Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Month-Previous Month data in Qlik

Hi,

I am facing a issue in qlik where we need to get the difference of sum(Selected Month Year) and Sum(Previous Month Year) .

The expression is giving correct totals but it is giving me two rows for one selection. When I am selecting june it is giving me 2 rows one is for june and one is for may. I want only selected year in my table.

Please find the attached screenshot and  expression I am using. Please help me with the same.

(

Sum({<[Accounting Year Month Calendar.AccountingMonthYear]={"$(=Max([Accounting Year Month Calendar.AccountingMonthYear]))"}>}[Financial Loss Reserve Amount])

-

Sum({<[Accounting Year Month Calendar.AccountingMonthYear]={"$(=Date(Addmonths(Max([Accounting Year Month Calendar.AccountingMonthYear]),-1),'MMM-YYYY'))"}

>}[Financial Loss Reserve Amount])

)


Thanks in advance


Regards,

Manu

3 Replies
sunny_talwar

How about this:

(Sum({<[Accounting Year Month Calendar.AccountingMonthYear]={"$(=Max([Accounting Year Month Calendar.AccountingMonthYear]))"}>}[Financial Loss Reserve Amount])

-

Above(Sum({<[Accounting Year Month Calendar.AccountingMonthYear]={"$(=Date(Addmonths(Max([Accounting Year Month Calendar.AccountingMonthYear]),-1),'MMM-YYYY'))"}>}[Financial Loss Reserve Amount]))

)

Not applicable
Author

Hi Sunny,

Thanks for your reply.

I am using it with above when no selections are there.

But the issue is when we select month year. Actually we need to give it as a master item to the users. So they will be using this master item with month year . When we select nothing then it is fine but on selection the logic with above is not working.

Thank you,

Regards,

Manu

sunny_talwar

I think it might be helpful if you can share your application. Would that be possible to do?