Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All, I need to pull the day name out of a date - so values like Sun Mon Tue Wed Thu Fri Sat coming out of values like 12/21/2015. What's the function? (I'll be doing trial and error while this post waits for a correct answer.
Someone wants to know most popular day of the week for users to log their entries.)
oh jeez! none.
i was expecting the function to just return an integer, but it returns a dual with the day names in WWW format no less.
You can definitely call me out for not testing before posting... but perhaps based on our qlik documentation ("returns an integer") we should make some updates.
Perhaps this was the same reason for the original post from the member?
Here is the documentation for latest and greatest SR12.
----------------
Week day. Returns an integer between 0-6.
Example:
weekday( '1971-10-30' ) returns 5.
If the date format used does not correspond to the one set in your operating system, QlikView will not be able to make a correct interpretation. See above under day(date).
Jonathan, I see where you were coming from. The doc is wrong.
The QV12 doc is correct.
Note that in QV12, an optional weekstart parameter is now available.
-Rob
Hi,
to get long week day names instead of the short names the WeekDay() function returns, you could also use something like:
SET vLongWeekDay = Dual(Date($1,'WWWW'),WeekDay($1));
table1:
LOAD *,
$(vLongWeekDay(DateField)) as LongWeekDay,
WeekDay(DateField) as WeekDay
Inline [
DateField
12/21/2015
12/22/2015
12/23/2015
12/24/2015
12/25/2015
12/26/2015
12/27/2015
12/28/2015
12/29/2015
12/30/2015
12/31/2015
];
hope this helps
regards
Marco