Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all there,
How can I create a weekend dates field using system date and weekend date should be every Sunday??
Example:
Weekend
05/01/2016
05/08/2016
05/15/2016
05/22/2016
05/29/2016
likewise for every month??
What's the significane of system date here? WeekEnd would be a weekend right, or am I missing something important here?
I strongly recommend you in the Master calendar just add one additional flag like:
If(weekday(date) = 6, 1, 0) as Weekend_flag;
I have one date field in data, but i should not use that date field to get the weekend dates, so i thought that it can be done using system date, if any other possibility, let me know
Thanks
Prashanth
Once again. I am not sure what system date needs to do here? System date should be 06/03/2015 (today), what does that need to do with the weekend? Do you just want the weekend based on Today's date? try this
WeekEnd(Today(), 0, 0)
I have only one date field which i should not use to create weekend dates field. so i thought like system will do the job. Is there any possibility to get the same without any date column?
thanks
Prashanth
Okay let me clarify you one thing. I have date field like
Postdate
05/04/2016
05/09/2016
05/15/2016
05/17/2016
I need to create weekend dates for respective records
Expected:
Postdate CreatedWeendend
05/04/2016 05/08/2016
05/09/2016 05/15/2016
05/12/2016 05/0152016
05/17/2016 05/22/2016
thanks
Prashanth
Try like this:
SET FirstWeekDay=0;
LOAD Postdate,
WeekEnd(Postdate, 0, 0) as CreatedWeendend
FROM Source;
UPDATE:
Added an environmental variable
sorry to confuse you, but I should not use the Post date field. Any other way that can do the job??
But if you are using Postdate as reference point, how can you not use it? Outside QlikView how would you do this?