Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Newhaven
Contributor III
Contributor III

Checking in Holiday

Hi.

 

Following problem.

I have a table with workdays and if day is a holiday or not:

 

Workday Holiday
09.01.2023 N
10.01.2023 Y
11.01.2023 Y
12.01.2023 Y
13.01.2023 Y
16.01.2023 N
17.01.2023 N
18.01.2023 N
19.01.2023 N

 

In a script I getting as a result a date. For example 10.01.2023

Now I need a script where I coul check if the result is a holiday. If yes I need the next possible workday.

In this case the result should be 16.01.2023

 

Could you help me?

Thx.

Labels (1)
3 Replies
menta
Partner - Creator II
Partner - Creator II

You can create a new field in script that is the next workingday

 

For example

 

temp:
LOAD * INLINE [

Workday, Holiday
09.01.2023, N
10.01.2023, Y
11.01.2023, Y
12.01.2023, Y
13.01.2023, Y
16.01.2023, N
17.01.2023, N
18.01.2023, N
19.01.2023, N
];

data:
Load *,
if(Holiday='Y', Peek('Test'), Workday) as Test
Resident
temp
order by Workday desc;

drop Table temp;

 

 

Newhaven
Contributor III
Contributor III
Author

Tought about this.

But my data table has different results.

Like

Workday calender:

Workday Holiday
09.01.2023 N
10.01.2023 Y
11.01.2023 Y
12.01.2023 Y
13.01.2023 Y
16.01.2023 N
17.01.2023 N
18.01.2023 N
19.01.2023 Y
20.01.2023 Y
23.01.2023 N
24.01.2023 N
25.01.2023 Y
26.01.2023 Y
27.01.2023

Y

30.01.2023

N

 

Data:

Date Nex Workday
10.01.2023 16.01.2023
13.01.2023 16.01.2023
23.01.2023 24.01.2023
26.01.2023 30.01.2023

 

So I need different results for different dates.

menta
Partner - Creator II
Partner - Creator II

Have you sorted desc the workday field?