Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
aaronnayan
Contributor III

Set analysis include date selection

Hi guys

I want to create a KPI to show last month sales.

I have created a date field to show this

SUM({<DATESORT={-1}>}Sales)

However If i select DATEMONTH, I want the above expression to be dynamic and change to the selected month.

Any ideas?

THanks,

Aaron

2 Replies

Re: Set analysis include date selection

Then why are you hard coding this? May be try this

Sum({<DATESORT = {$("$(=Max(DATESORT)-1)"}>}Sales)

Re: Set analysis include date selection

Or this

Sum({<DATESORT = {$("$(=Max(DATESORT)-1)"}, DATEMONTH>}Sales)