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: 
Not applicable

how to show last month data with current month selection

how to show last month data with current month selection ????

5 Replies
sushil353
Master II
Master II

=sum({<month={">=$(Max(Month)-1) <=$(Max(Month))"}>}value)

somenathroy
Creator III
Creator III

{<Date={'$(=Max(Date))'}>}

[where Date is Calendar Date of the selected month]

or you may use

{<TDate={'$(=Max(TDate))'}>}

[where TDate is Transaction date of the selected month]

Regards,

Som

jagan
Partner - Champion III
Partner - Champion III

Hi Vignesh,

If you have a date field in your table then use this

=Sum({<MonthField=, DateField={'>=$(=MonthStart(Max(DateField), -1))<=$(=MonthEnd(Max(DateField), -1))'}>} Sales)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi

use the addmonths function

AddMonths(START_DATE,-1)

use this in ur expr tab

it works

neha_shirsath
Specialist
Specialist

Hi Vighnesh,

Try this Expression-

=sum({<Year={$(=max(Year))},Month={$(=month(addmonths((max(Date)),-1)))}>}Sales)

Regards,

Neha