Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day,
I am trying to calculate the sum of amount using a current month status ='Active' irrespective of the previous statuses.I tried the below expression and it does not work.Your help will be highly appreciated.
if(match(Only({<Month={$(vMaxMonth)}>}Status),'Active'),Sum(Amount))
I would like to do this on the front-end so that the date changes with the month selection.
look at this post, its the same design pattern:
Max Date per Month - Qlik Community - 1527312
it gets the last value of a specific column. if you use this you can get the last status per ID just test that:
the first expression gets the last status, the 2nd expression tests that status and if active returns the total - effectively disregarding prior statuses. obviously, you dont need the first expression - added just so you see how it works
only(Aggr(If(month = Max(TOTAL <ID> month), only(status)), month, ID))
if(only(Aggr(if(month = Max(TOTAL <ID> month), only(status)), month, ID))='Active', sum(amount))
Thank you so much for this, but are you able to any values if you just have Region and Amount as columns? I am getting nulls.
how will you be able to include amount as dimension when you are summing it?
if you want region added as a dimension, just add it in all the aggregations: