Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
phongnnguyen
Contributor II
Contributor II

Set Analysis Previous Date Range

Hi Qlik Senser,

I'm fresh in Qlik, I have a problem when I set Analysis Date range for Previous.I want to show sum Revenue of the month before the currently month. For instance:


I choose in filter chart from 2018-Apr-01 to 2018-Apr-30 and in the KPI chart will show the revenue from 2018-Mar-01 to 2018-Mar-31

This is my code: Sum({<TradeDate={">=$(=MonthStart(AddMonths(max(TradeDate),-1))<=$(=MonthEnd(AddMonths(max(TradeDate),-1))"}>}if( K=0 and Interest>0,Interest))

Thanks for you help.

5 Replies
sunny_talwar

May be try this

Sum({<TradeDate = {">=$(=MonthStart(Max(TradeDate), -1))<$(=MonthStart(Max(TradeDate)))"}, K = {0}, Interest = {">0"}>} Interest)

phongnnguyen
Contributor II
Contributor II
Author

Thanks for your reply, but maybe this has problem when I use MonthStart and Month End

Anonymous
Not applicable

Hye,

why not The As-Of Table as u told me Sunny ?

sunny_talwar

Well you can use AsOfTable, but not every issue needs it... in this case, it doesn't seem the OP is comparing periods on a single chart where period is the dimension or looking to accumulate the value of the period where period is the dimension. Those are the two cases where I can think it to be most useful, but it is not to say that it can't be used.

sunny_talwar

Are you able to share a sample to show the issue?