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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Trim WeekDay function to show First letter

Dear Qlikview user

I am using the WeekDay function and as expected it returns values from Mon, Tue, Wed, Thur, Fri, Sat, Sun

I would like to trim down the WeekDay function so it just returns the first letter of each day  I.e. M, T, W, T, F, S, S

Does anyone know how this can be achieved?

Kind Regards

Helen

1 Solution

Accepted Solutions
sunny_talwar

Even the second method?

Dual(Left(WeekDay(Date), 1), Num(WeekDay(Date))) as [1stLetterWeekDay]

View solution in original post

7 Replies
sunny_talwar

May be like this:

Left(WeekDay(Date), 1) as [1stLetterWeekDay]

or

Dual(Left(WeekDay(Date), 1), Num(WeekDay(Date))) as [1stLetterWeekDay]

jpenuliar
Partner - Specialist III
Partner - Specialist III

Try modifying the MAIN script tab

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

to below::

SET DayNames='M;T;W;T;F;S;S';

helen_pip
Creator III
Creator III
Author

Hello Sunny

Thank you for your response

I have tried your techniques and unfortunately they are grouping the letters which are the same together I.e. Tue and Thu and both come under T now

Is there any way to stop the aggregation?

Kind Regards

Helen

avinashelite

Its the Qlikview nature to group the similar data if you have T and T how you will different it as Tue and Thu (don't consider the week order) .

sunny_talwar

Even the second method?

Dual(Left(WeekDay(Date), 1), Num(WeekDay(Date))) as [1stLetterWeekDay]

helen_pip
Creator III
Creator III
Author

Your right Sunny

My mistake!  The second option does work

Thank you so much!

Thanks

Helen

sunny_talwar

Although, I think you should also look into jpenuliar‌'s solution. I think its sleeker than what I provided