Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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
Luminary Alumni
Luminary Alumni

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