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

picking out working days for current month

Hi experts,

i have the following script

FOR i = 0 to 12

LET vMonthT = MONTH(ADDMONTHS($(vToday),-$(i)));

LET vMonthN = NUM(MONTH(ADDMONTHS($(vToday),-$(i))));

LET vYearT= YEAR($(vToday));

//LET vYearT = YEAR(ADDMONTHS($(vToday),-$(i)));

  SRDaysMonth:

  LOAD

  BRNO,

  MONTHNAME(MAKEDATE($(vYearT),$(vMonthN),1)) as SALESMONTH,

  SUM(SRDAYS) as SRDAYS

  FROM

  [\BRANCH_CALENDAR.qvd]   (qvd)

  WHERE EXISTS(BRNO) AND YEAR(BHDATE) = '$(vYearT)' AND MONTH(BHDATE) = '$(vMonthT)' AND

BHDATE < $(vToday)

  GROUP BY BRNO;

Next i;

LET vMonthT =;

LET vYearT =;

LET vMonthN=;

from the above script how can i get SRDAYS for current month alone. (SRDAYS will vary according to theBRNO. it is nothing but the working days)

i have already set some variables to define current date,year,month......previous months,years.....

Please assist me in fixing this issue asap.

2 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hello,

I think you can use the  net workdays function to get the list of working days excluding sat,sun and Holidays

Syntax: networkdays (start:date, end_date {, holiday})

Not applicable
Author

hi sree anarasi,

thanks for your reply,

i have my start date as vMyfirstday

                end date as vMylastday

these networkdays should be calculated for a field named SRDAYS.

i dont have setup holiday.

(saturday is halfaday, sunday is holiday)

Please help me with the script