Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
stevelord
Specialist
Specialist

Function to pull the day name from a date value?

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.)

12 Replies
JonnyPoole
Former Employee
Former Employee

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.

----------------

weekday(date)

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).

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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

MarcoWedel

Hi,

to get long week day names instead of the short names the WeekDay() function returns, you could also use something like:

QlikCommunity_Thread_197361_Pic1.JPG

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