Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a date field 'DOB' which is formatted as mm/dd/yy (3/21/2017)
Is there a way within the script to indicate the 'Day Name' in so that I can have a field called Week Day?
I tried WeekDay(DOB) AS dayofweek however this returns the numeric value of the date, whereas I am looking for the actual day name (Monday, Tuesday, etc)
I am getting Tue when I tried this
WeekDay(Today())
Can you check your environmental variables for this?
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
I am trying to do this in the script. I want to create a field called weekday so that I can then utilize that field in charts, list boxes, tables, etc.
My environmental variables are set in the correct manner.
Should give your the name (in the script also) unless you are using Num() function over it?
maybe, if in a listbox DOB is on the left
weekday(date#(DOB, 'M/D/YYYY'))
My data:
Item | Sale Department | Master Sale Department | DOB | Daypart | Quantity | Net Amount | Gross Amount |
Breads | HS Condiments | Food | 1/30/2017 | LUNCH | 1 | 0 | 0 |
My script:
DOB as businessdate,
Month(DOB) as month
Year(DOB) as year
Is there a way to do this in the script to produce a day of week field that will appear as Monday, Tuesday, Wednesday, etc
what about:
Date(DOB, 'WWWW') As WeekDayLongName
Hi,
one solution might be also:
SET DateFormat='MM/DD/YYYY';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames ='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
table1:
LOAD *,
DOB as businessdate,
WeekDay(DOB) as dayofweek,
Dual(Date(DOB,'WWWW'),WeekDay(DOB)) as longdayofweek,
Month(DOB) as month,
Year(DOB) as year
FROM [https://community.qlik.com/thread/254226] (html, codepage is 1252, embedded labels, table is @1);
hope this helps
regards
Marco