Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
joshmartyne
New Contributor III

Re: Measuring difference between Max week and previous in a KPI Widget

Attached

Re: Measuring difference between Max week and previous in a KPI Widget

So essentially if Month is selected you will do a comparison to previous month and if Week is selected the comparison will be done to previous week? What about selection in Year or Date? If you select a date, will it then compare to yesterday also?

joshmartyne
New Contributor III

Re: Measuring difference between Max week and previous in a KPI Widget

At the moment Month and Week is my only requirement. However it would also be good if this could be extended to Year or Date (Exactly how you stated). Im hoping that if I see how this could be done with Week and Month I can work out how to do other time periods myself aswell.

Thanks

Re: Measuring difference between Max week and previous in a KPI Widget

May be try this expression for Previous Period

If(GetSelectedCount(Week) > 0,

Count({<Start_Date = {"$(='>=' & Date(WeekStart(Max(Start_Date), -1)) & '<=' & Date(WeekEnd(Max(Start_Date), -1)))"}, Week, Month>}Incident),

If(GetSelectedCount(Month) > 0,

Count({<Start_Date = {"$(='>=' & Date(MonthStart(Max(Start_Date), -1)) & '<=' & Date(MonthEnd(Max(Start_Date), -1)))"}, Week, Month>}Incident)))

I am not sure if colors and directions or error are right or not. If the incidents went down from previous period the previous period number will be in green with down arrow?

Capture.PNG

I am sure you will be able to fix the colors.

HTH

Best,

Sunny

joshmartyne
New Contributor III

Re: Measuring difference between Max week and previous in a KPI Widget

Perfect! Many Thanks!