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: 
master_student
Creator III
Creator III

expression

Hello Guys,

Capture.PNG

This expression give me the value of the selectes month and year

=(num(sum( {$<[Year of date]={$(=Max([Year of date]))}>} recharge_amount),'# ##0')- num(sum( {$<[Year of date]={$(=Max([Year of date])-1)}>} recharge_amount),'# ##0')) / num(sum( {$<[Year of date]={$(=Max([Year of date])-1)}>} recharge_amount),'# ##0') *100

I need the expression that give me the value of the selected year and the month -1( in this case august)

the filed month is [Month of date]

Thank you

1 Reply
sunny_talwar

May be like this

Create a new field in the script like this

LOAD [Year of date],

     [Month of date],

     Date(Date#([Month of date] & ' - ' & [Year of date], 'MMMM - YYYY'), 'MMM-YYYY') as MonthYear

     ...

FROM ....;

and then this:

=(Sum({$<[Year of date], [Month of date], MonthYear = {"$(=Date(AddMonths(Max(MonthYear), -1), 'MMM-YYYY'))"}>} recharge_amount) - Sum({$<[Year of date], [Month of date], MonthYear = {"$(=Date(AddMonths(Max(MonthYear), -13), 'MMM-YYYY'))"}>} recharge_amount)) / Sum( {$<[Year of date], [Month of date], MonthYear = {"$(=Date(AddMonths(Max(MonthYear), -13), 'MMM-YYYY'))"}>} recharge_amount) * 100