3 Replies Latest reply: Jun 20, 2018 4:42 AM by Petter Skjolden RSS

    Question: Is it possible to use a field as a parameter for Networkdays() function?

    Marian Szetyinszki

      I load a simple table with 3 fields: StartDate (Depot In) , EndDate (Depot Out)  , and coma separated list of Holiday dates (HL) (example line):




      I want to calculate Networkdays during load script from this table:



      Networkdays([Depot In],[Depot Out], HL) as NetDays

      Resident holidayTable;


      Help for the function says:

      networkdays (start_date, end_date [, holiday])


      BUT: The script result does not exclude holidays, despite the field HL is a list of coma separated dates. I get the same result, as if i did not provide the list of holiday dates.


      What is the correct way of passing the function argument from an existing field?



      Qlik help just states: holiday list is " Holiday periods to exclude from working days...

      separated by commas.

      Example: '25/12/2013', '26/12/2013', '31/12/2013', '01/01/2014'

      My field HL is exactly the coma separated list as in the example.

      Is it a bug in the function, or the HL field must be passed in a different way?

      I want to avoid using variable/cycle through the data, because this is very unproductive script when one works with millions of rows of data. (I do not want the script as in the example :