Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
KRS772
New Contributor

Create summed expression of most recent month (selected or not)

Hello,

I am trying to create a text summary that summarizes quantity from three dimensions. So total where A=x; B=x; and C=x. My issue is that one of the dimensions is Month. I tired num(sum(if(match([month_field],max(month_field),qty_field,0)),'#,##0') and this results in errors. I'v tried creating a variable of most recent month and matching month_field to that but both result in 0.

I'd like to have this static so that selections of months don't impact the text summary, but i'd settle just to formulate the expression so it works. 😉

 

Thanks,

K

1 Solution

Accepted Solutions

Re: Create summed expression of most recent month (selected or not)

May be try this

Num(Sum(If(Match([month_field], Max(TOTAL month_field), qty_field, 0)), '#,##0')

or this

Num(Sum({<[month_field] = {"$(=MaxString(month_field))"}>} qty_field), '#,##0')

View solution in original post

4 Replies

Re: Create summed expression of most recent month (selected or not)

Try this?
Alt(num(sum({<month_field={$(=max(month_field))} qty_field),'#,##0'), 0)
Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
KRS772
New Contributor

Re: Create summed expression of most recent month (selected or not)

Thank you. The syntax looks good and the expression is valid but I get the following error:

Error: Error in set modifier ad hoc element list:
',' or ')' expected

Re: Create summed expression of most recent month (selected or not)

May be try this

Num(Sum(If(Match([month_field], Max(TOTAL month_field), qty_field, 0)), '#,##0')

or this

Num(Sum({<[month_field] = {"$(=MaxString(month_field))"}>} qty_field), '#,##0')

View solution in original post

KRS772
New Contributor

Re: Create summed expression of most recent month (selected or not)

Thank you. The second code gave me exactly what I was looking for