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;
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.
Try by adding single quotes using Chr(39) around your holidays
LOAD Concat(Chr(39) & [Date] & Chr(39), ',') as [Date]
FROM [lib://QVDs/HOLIDAYS.qvd] (qvd);
View solution in original post
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.