Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count days between current selection in Master Calendar

Hi Guys,

I have a master Calendar setup on my dashboard (Code Below):

(Code Below)

I need to find the number of weekdays days (Monday - Friday inclusive) currently selected on the master calendar in order to use it as part of an expression

Any help would be helpful,

I vaguely remember covering somehting about calculating current selections in Qlikview Training but that was a while back.

Thanks in advance

L

//**** MASTER CALENDAR****

MINMAX:
LOAD
Min(LoggedDate) as MinDate,
Max(LoggedDate) as MaxDate
RESIDENT Richmond;
LET vMinDate = Num(Peek('MinDate',0,'MinMax'));
LET vMaxDate = Num(Peek('MaxDate',0,'MinMax'));
LET vToday = $(vMaxDate);

//**** Temp Calendar****
TempCal:
LOAD
    
date($(vMinDate) + rowno()-1) AS TempDate
    
AUTOGENERATE
    
$(vMaxDate)-$(vMinDate)+1;
    
DROP Table MINMAX;

//********Master
Calendar******


MasterCalendar:
LOAD
TempDate AS LoggedDate,
Week(TempDate) AS Week,
Year(TempDate) AS Year,
Month(TempDate) AS Month,
Day(TempDate) AS Day,
Weekday(TempDate) AS WeekDay,

'Q' &
ceil(month(TempDate) / 3) AS Quarter,
DATE(Monthstart(TempDate),'MMM-YYY') AS MonthYear,
Week(TempDate)&'-'&Year(TempDate) AS WeekYear,
InYearToDate(TempDate,$(vToday),0)*-1 AS LastYTDFlag
RESIDENT TempCal
ORDER BY TempDate ASC;


DROP TABLE TempCal;

10 Replies
Not applicable
Author

Sebastian!

BINGO!

sum({<specialist=>}_Work_Day_Flag)

worked perfectly!

It now 'locks' the calculation down to the selected dates just like I wanted!

Thank you soooo much!

L