Skip to main content
Announcements
Qlik Announces Qlik Talend Cloud and Qlik Answers: LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dineshkumar
Contributor III
Contributor III

Exclusion of dates

hi all,

i have atached two files one is holiday list and other contains dimensions.

in my report i want a column resolution date which is walkin date+2 (excluding holiday in holiday list)

e.g. if today is friday, then friday(06/01/2017) +2 is actually sunday(08/01/2017) but i want tuesday(10/01/2017)(as saturday, sunday are holiday), in case if monday(09/01/2017) is a holiday i want resolution date as wednesday(11/01/2017)

thanks in advance

1 Solution

Accepted Solutions
marcus_sommer

My statement was for working within the gui and couldn't be applied directly within the script because without a lookup-function you couldn't access fields from other tables, concat() would require an aggregation load and within the script is only a one-step $-sign expansion possible like $(var) and not a two-step expansion like $(=var). Within the script you need something like this:

Holidays:

load chr(39) & concat(Holdidays, chr(39) & ',' & chr(39)) & chr(39) as HolidayList

from Holidays;

let vHolidayList = peek('HolidayList', 0, 'Holidays');

drop tables Holidays;

load

.

.

LastWorkDate(Date_column, 3, $(vHolidayList))

.

.from ... . . .

- Marcus

View solution in original post

4 Replies
marcus_sommer

Try it with lastworkday() maybe in this way:

lastworkday(Date, 2, '$(=concat(Holidays, chr(39) & ',' & chr(39)))')

- Marcus

dineshkumar
Contributor III
Contributor III
Author

Hi marcus,

Already tried, its not considering date in holiday list, by default it takes sat sunday nly as holiday and displaying result...

Im having:

set vHoliday=chr(39)&concat(Holidays_Dates, chr(39) & ',' & chr(39))&chr(39);

load

.

.

LastWorkDate(Date_column, 3, '$(=vHoliday)')

.

.from ... . . .

but if there is three, four consecutive holiday it fails.

marcus_sommer

My statement was for working within the gui and couldn't be applied directly within the script because without a lookup-function you couldn't access fields from other tables, concat() would require an aggregation load and within the script is only a one-step $-sign expansion possible like $(var) and not a two-step expansion like $(=var). Within the script you need something like this:

Holidays:

load chr(39) & concat(Holdidays, chr(39) & ',' & chr(39)) & chr(39) as HolidayList

from Holidays;

let vHolidayList = peek('HolidayList', 0, 'Holidays');

drop tables Holidays;

load

.

.

LastWorkDate(Date_column, 3, $(vHolidayList))

.

.from ... . . .

- Marcus

qliknirmal
Contributor
Contributor

Hi Dinesh,

Have you got the solution for this issue.