Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm having trouble coming up with the necessary code needed for a KPI chart. I currently have two working Master Items that I'm using in a simple table - a dimension for Year Months in the max available year and a measure for number of accounts opened each Year Month. Here's the code for each.
Year Month:
=if(left([Year Month],4) = $(vMaxYearApp), [Year Month])
Opened:
=count(if([OP Account Open Date] >= [First Of Month], [OP Account ID]))
And here's an example of the results in the table
I'd like a single measure that combines the logic from my two master items and properly aggregates to the total for all months (circled in the image). I also need it to filter properly when a user chooses specific years and/or one or more Year Month values from a filter pane.
My thought is that the aggr() function may come in handy here? I'm still a bit new to Qlik and that function's logic though, so I'm not sure.
This should work (I think) if you have an Year field created in the script
=Count({<Year = {"$(=Max(Year))"}>} If([OP Account Open Date] >= [First Of Month], [OP Account ID]))
This should work (I think) if you have an Year field created in the script
=Count({<Year = {"$(=Max(Year))"}>} If([OP Account Open Date] >= [First Of Month], [OP Account ID]))