Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to know the name of a day of the week

Given a list box containing dates as shown in the figure, would like to have for each date, name of the day of the week.

data.JPG.jpg

ES. 12/feb/2014 -----------> Wednesday 12/feb/2014


From the user's guide I read that you have to use WWW in the script. Where to use the WWW? What should I do?

Thanks to all
Carlo

1 Solution

Accepted Solutions
jebamalai
Valued Contributor

Re: How to know the name of a day of the week

If you want to simply update your list box to show you can also add the Date as well as go to the expressions and add the below.

=WeekDay(DateField)

7 Replies

Re: How to know the name of a day of the week

You can set a variable in the script for the long day names:

Set LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

You can then use the date() function to show the long day name: date(MyDateField, 'WWWW'). In chart objects you can often set the date format on the Number tab by selection Override Document Settings, selecting Date and set the date format to WWWW.


talk is cheap, supply exceeds demand
Employee
Employee

Re: How to know the name of a day of the week

In addition to Gysbert's answer:

You will automatically also have a

     Set DayNames = ...

defined in the script. These day names are used in the WeekDay() function and if you use WWW:

     WeekDay(MyDate) as WeekDay,

     Date(MyDate,'WWW YYYY-MM-DD') as WeekDay2,

HIC

jagannalla
Valued Contributor III

Re: How to know the name of a day of the week

Hi,

In load statement just use weekday statement.

Set LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

Load

*,

WeekDay(DATA)&' '& DATA AS WkDay

from table;

Not applicable

Re: How to know the name of a day of the week

Thank you all. I followed your advice and using the WeekDay I managed to get the desired result.

Many thanks
Carlo

Re: How to know the name of a day of the week

please mark as answered

thanks

regards

Marco

jebamalai
Valued Contributor

Re: How to know the name of a day of the week

If you want to simply update your list box to show you can also add the Date as well as go to the expressions and add the below.

=WeekDay(DateField)

Not applicable

Re: How to know the name of a day of the week

Thanks Jebamalai I finally did what you say; I find it easier that way.

thank you very much


Carlo

Community Browser