Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
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.
Have you sorted desc the workday field?