Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to use a KPI widget to show Numbers of Incidents for the Max week, Then add an up down arrow or conditional limit to show how this changed from the week previously.
I have tried to add a master calendar and from posts ive read I think that I need use use (Max(Date) and (Max(Date)-1) but haven't had any luck.
Examples of the kind of expressions ive tried are below
//Count(Incident)
//Count( {$<Year = {$(#varMaxDate)}>} Incident )
//=Count({<Month={$(=Max(Month)-1)}>} Incident )
//Count({<Month={$(=Max(Month)-1)}>} Incident)
//Count({<MonthName={"$(=Month(Max(Date)-1))"},Year={"$(=(Year))"}>}Incident)
//Count({$<MonthYear={$(=Only(MonthYear)-1)}>}Incident)
//Count({<Month = {$(MONTH =(MAX(Date))}>} Incident
//Count({<Year = {$(MAX(Year))},Month = {'$(=MONTH(MAX(Date)))'}>}Incident)
Any help would be much appreciated.
QVF attached
Thanks
Josh
Attached
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?
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
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?
I am sure you will be able to fix the colors.
HTH
Best,
Sunny
Perfect! Many Thanks!