Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
nate_ak
New Contributor III

KPI For Aggregation of Measure by Month?

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

table.PNG

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. 

Tags (3)
1 Solution

Accepted Solutions

Re: KPI For Aggregation of Measure by Month?

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]))
1 Reply

Re: KPI For Aggregation of Measure by Month?

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]))