Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Attached please find the qvw. Here is a brief description of the issue.
I have a table with years 2016 and 2017, each year has a monthly snapshot Amounts. I would like to sum the Amounts for each "Year" but only for the maximum MONTH_ID.
So in this case I would like to see Year 2016 Sales Amount ='1000000' and Year 2017 Sales Amount ='1000000' also.
Using Qlik 11.2 SR13
Any suggestions.
You are already using dimension as Year.
Why dont you just use Amounts as your expression.
What exactly is your requirement or trying to achieve in that table?
Expr: = Amounts
OR
Expr: = Max({< Year = { $(=Max(Year)-1), $(=Max(Year)) } >} Amounts)
May be this?
=FirstSortedValue(Amounts, -TRANS_ID)
or this:
=FirstSortedValue(Aggr(Sum(Amounts), TRANS_ID), -TRANS_ID)
I tried using urs in my original App and it doesnt work,Below is my actual expresion
FirstSortedValue(Aggr(Sum({<Entity_Type={'O'}>} LIMITS), MONTH_ID),-MONTH_ID)
I won't know what exactly is going wrong, but one suggestion might be to use the set analysis for the firstsortedvalue() function also
FirstSortedValue({<Entity_Type={'O'}>} Aggr(Sum({<Entity_Type={'O'}>} LIMITS), MONTH_ID),-MONTH_ID)
Sunny, can we use only() outside the aggr() get that specific monthID ? Just wondering?
LLike
firstsortedvalue(limits, -only(aggr(sum(), month_id))
I don't think this is a correct syntax....
Sorry you are right. I dont know what i was thinking.