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: 
poojashribanger
Creator II
Creator II

Dynamic KPI calculation for last 30 days based on Filter condition

Hello All,

I have a Report Period filter which has values like(YTD,MTD,Last Year,Year,Reporting Period,Week,Last Week).

for this filter i want to calculate a count(customer) for last 30 days but for previous period.

For Ex. if i have data till 2024 then my YTD is having jan to july 2024,MTD is having July 2024,Reporting period is today()-1.

I have done this using below expression but my chart is taking long time to load, also I have date filter in my dashboard,

For ex. if some one selects any date then it should show last 30 days w.r.t that.

can we implement this in some other way?

pick(wildmatch(REPORT_PERIOD,'Reporting Period','Quarter','Last Quarter','Last Year','YTD','MTD','Year','Last Month','Month','Week','Last Week'),
 
count( {<    
event_date={">=$(=date(addmonths(max({<Flag={"Daily Active User"},REPORT_PERIOD >}REPORT_CHART_DATE),-2)-29,'YYYY-MM-DD'))<=$(=addmonths(max({<Flag={"Daily Active User"},REPORT_PERIOD >}REPORT_CHART_DATE),-2))"},
            REPORT_PERIOD=,
Flag={"Daily Active User"}     >} distinct id
).........
 
Thanks in Advance,
Poojashri

 

 

Labels (1)
0 Replies