Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jimmygohhanjie
Contributor III
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
sunny_talwar

May be using Dual function

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

View solution in original post

6 Replies
sunny_talwar

May be using Dual function

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

maximiliano_vel
Partner - Creator III
Partner - Creator III

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

sasiparupudi1
Master III
Master III

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

jimmygohhanjie
Contributor III
Contributor III
Author

Thanks,

It worked too.

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

jimmygohhanjie
Contributor III
Contributor III
Author

Thanks. It works.

jimmygohhanjie
Contributor III
Contributor III
Author

Hi, the @3 are dates.

thanks for your time.

the above and below solution meets my needs.