Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
rustyfishbones
Honored Contributor 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
Esteemed Contributor II

Re: Expression to Return Weekday

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!

View solution in original post

3 Replies
vinieme12
Esteemed Contributor II

Re: Expression to Return Weekday

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!

View solution in original post

rustyfishbones
Honored Contributor II

Re: Expression to Return Weekday

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
Esteemed Contributor II

Re: Expression to Return Weekday

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