Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

Excluding Every Friday from NetWorkdays()

Dear All,

As you all know ...the networkday() function excluding saturday and sunday from TAT calculation. However i want to exclude friday also or the day which i want to exclude from TAT calculation...

is there any way to achieve this ...if yes how i can implement the same.

help would be much appreciated...

Sarfaraz

3 Replies
tamilarasu

Hi Sarfaraz,

In this case, you can use third parameter holiday list in Networkdays() function. First, create a load script to capture all Fridays and store them in a variable. After doing that, you can use the variable in Networkdays() function as third parameter. Here is an example,

Let vMinDate = Num(MonthStart(Today()));

Let vMaxDate = Num(Today());

Holiday:

Load Concat(Chr(39) & Date & Chr(39) ,', ' ) as Date Where Weekday(Date)='Fri';

Load  Date($(vMinDate)+iterno()-1) as Date

Autogenerate 1 While $(vMinDate) + Iterno() -1 <= $(vMaxDate);


Let vHoliDays = Peek('Date',0,'Holiday')

Drop table Holiday;

Now, you can use the variable like Networkdays(StartDate, EndDate. $(vHoliDays))

In above example, I just took current month start date as start date and today's date as end date for understanding. You can find vMinDate and vMaxDate from your source table like below,

Temp:

LOAD

     Min(DateFieldName) as MinDate,

     Max(DateFieldName) as MaxDate

Resident SourceTableName;

LET vMinDate = Peek('MinDate');

LET vMaxDate = Peek('MaxDate');

Drop Table Temp;

You can concatenate holiday list other than Friday  (as well)  in holiday table.

Hope this helps.

qlikviewnovice
Specialist II
Specialist II

Hi,

Follow this link:

Master Calendar with Working days &amp; Holidays Flag

Hope it helps!!