Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rustyfishbones
Master II
Master II

Expression to Return Weekday

Hi All,

I have the following Expression, the expression is Correct, it returns Mon, how can I get it to return Monday

FirstSortedValue(Weekday, -Aggr(Sum({<TrxType = {'R'},ActionID = {'RECEIPTS'}>}[Act-Storage]) ,Date,Weekday))

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

So values in the field Weekday are stored as Mon, Tue , Wed?


Then you will have to use Pick (Match

Pick(Match(

FirstSortedValue(Weekday, -Aggr(Sum({<TrxType = {'R'},ActionID = {'RECEIPTS'}>}[Act-Storage]) ,Date,Weekday))

,'Mon','Tue','Wed','Thur','Fri','Sat','Sun')

,'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')


or Add a new field that has the full names for Weekday!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
vinieme12
Champion III
Champion III

So values in the field Weekday are stored as Mon, Tue , Wed?


Then you will have to use Pick (Match

Pick(Match(

FirstSortedValue(Weekday, -Aggr(Sum({<TrxType = {'R'},ActionID = {'RECEIPTS'}>}[Act-Storage]) ,Date,Weekday))

,'Mon','Tue','Wed','Thur','Fri','Sat','Sun')

,'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')


or Add a new field that has the full names for Weekday!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
rustyfishbones
Master II
Master II
Author

I thought I could do it like this

WEEKDAY(

FirstSortedValue(Weekday, -Aggr(Sum({<TrxType = {'R'},ActionID = {'RECEIPTS'}>}[Act-Storage]) ,Date,Weekday))

,'dddd')


but Pick Match will do


Thanks

vinieme12
Champion III
Champion III

Well you can actually do that by changing the below variable

From

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

To


SET DayNames='Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday';


and change the Weekday field to be a dual field example


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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.