Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Certification Exam Sale - 40% off. Register by June 30, 2020. GET DETAILS
Highlighted
New Contributor III

Convert String "Mon" to Date "Mon".

Hi,

This is my first post, do let me know if i am doing anything wrong.

Need some help. on converting String "Mon" to Date "Mon".

Those in Yellow is the expected result.

These are data from another table.  created using 'weekday(@3) As Weekday' (Not sure why these rows are showing in this table)

The red circle are string/text, which need to be converted into Date. so my list Box will show a single set of Mon- Fri.

These does not work. it is missing something, which i cant figure out

     weekday(Date(Date#(Weekday,'WWW')),'WWW') as Weekday,

     Date(Date#(Weekday,'DDD'),'WWW') as Weekday,

     Date#(Weekday,'WWW') as Weekday,

Capture.JPG  Capture.JPG

Thanks for looking at this..

appreciate your thoughts on this.

1 Solution

Accepted Solutions
Highlighted

Re: Convert String "Mon" to Date "Mon".

May be using Dual function

Dual(Weekday, Match(Weekday, 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'))

View solution in original post

6 Replies
Highlighted

Re: Convert String "Mon" to Date "Mon".

May be using Dual function

Dual(Weekday, Match(Weekday, 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'))

View solution in original post

Highlighted
Partner
Partner

Re: Convert String "Mon" to Date "Mon".

Does @3 is a Date?, ie. 27/03/2018 (DD/MM/YYYY). Just to clarify, the values marked with yellow have an underlying value of a date, on my example WeekDay('27/03/2018') returns 'Tue' with an underlying value of '27/03/2018'. So to convert 'Fri' to date 'Fri', you need a date in the format I mentioned.

Regards

Highlighted
Honored Contributor III

Re: Convert String "Mon" to Date "Mon".

WeekDay(Pick(Match(YourField,'Mon','Tue','Wed','Thu','Fri','Sat','Sun'),0,1,2,3,4,5,6))

Highlighted
New Contributor III

Re: Convert String "Mon" to Date "Mon".

Thanks,

It worked too.

however i will stick with Sunny's. it is cleaner

Highlighted
New Contributor III

Re: Convert String "Mon" to Date "Mon".

Thanks. It works.

Highlighted
New Contributor III

Re: Convert String "Mon" to Date "Mon".

Hi, the @3 are dates.

thanks for your time.

the above and below solution meets my needs.