Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shane_spencer
Specialist
Specialist

Convert Dayname to Date or Number

I've got a field that's a mix of Dayname (Mon, Tue, etc) and Date i.e 27/04/2018.

I also have a variable for Week Ending i.e. 25/05/2018 would be Friday. 

I somehow need to convert the Dayname to a number i.e. Mon = 0, Tues = 1

(so that I can convert the day name into date using that variable. i.e. Variable -4 + Dayname = Date)

See attached QVD. How do I convert the Mon, Tues etc in Day/Date field to a number?

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Use Pick() and Match():

Match([Day/Date], 'Mon','Tue','Wed') // this will return 1, 2, 3 depending on the order. If 'Sun' is the first value, then Sun = 1

Then add this value to the variable and you will get the full date.

View solution in original post

3 Replies
Miguel_Angel_Baeyens

Use Pick() and Match():

Match([Day/Date], 'Mon','Tue','Wed') // this will return 1, 2, 3 depending on the order. If 'Sun' is the first value, then Sun = 1

Then add this value to the variable and you will get the full date.

giovanneb
Creator II
Creator II

Hello Shane, try this

Best regards !

shane_spencer
Specialist
Specialist
Author

Thanks. The nested If was exactly what I was trying to avoid though.