Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mgDev
Contributor II
Contributor II

What is wrong with my working days function?

Hello,

Really hoping someone can help me with the problem I am facing here. 

I have a list of holiday dates stored in a qvd and am trying to use LastWorkDate() to add 3 working days to a date.

Here is how I assign it to a variable;

[Holidays]:
LOAD concat([Date],',') as [Date] FROM [lib://QVDs/HOLIDAYS.qvd](qvd);

LET vHolidays = peek([Date]);

Drop table [Holidays];

Here is how I then use the variable;

if([Alter Stock]='Adjust',date(LastWorkDate([Dock Date],4,$(vHolidays))),null()) as [New Stock],

This is the contents of the qvd;

mgDev_0-1600073858828.png

 

However I have for example 25/12/2020 listed as a holiday day - but when I come to use 'New Stock' field it still has 25/12/2020 as a result.

What have I done wrong please?

Happy to provide more info if required.

 

 

 

1 Solution

Accepted Solutions
sunny_talwar

Try by adding single quotes using Chr(39) around your holidays

[Holidays]:
LOAD Concat(Chr(39) & [Date] & Chr(39), ',') as [Date]
FROM [lib://QVDs/HOLIDAYS.qvd] (qvd);

 

View solution in original post

2 Replies
sunny_talwar

Try by adding single quotes using Chr(39) around your holidays

[Holidays]:
LOAD Concat(Chr(39) & [Date] & Chr(39), ',') as [Date]
FROM [lib://QVDs/HOLIDAYS.qvd] (qvd);

 

mgDev
Contributor II
Contributor II
Author

Thank you that solved my issue. 

I also noticed that in the documentation for the function it says each period requires a start and end date - my data had just previously been a list of single dates for each holiday date. So I changed this also.

Thanks again.