Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Kakurin_Denis
Contributor
Contributor

Difficult Aggr with COUNT

Good afternoon, dear colleagues!

I have a problem in my project. Hope someone could give me an advice.

1) I am loading table from db with columns: 

INN; FRAUD_RISK_ZONE;SCORE_DATE;RULESET

4D1D9D58-63D1-4BD8-A698-E89E45837FC0.jpeg

2) I want to make bar chart, where dimension is MONTH(SCORE_DATE). But the case is I should select 

only row with last score_date in month. On SQL it looks like B32D9E40-7430-4732-A2A9-6BF665BBC251.jpeg

 

In measure I tried COUNT(Aggr(distinct MAX(SCORE_DATE, MONTH, INN_NUM))).

but it works bad...because it doesn’t select correct FRAUD_RISK_ZONE.

this is the result:E8156183-3DB1-423C-BD40-4C4400202F19.jpeg

How I should write the measure that select rows with only max(SCORE_DATE)?
which takes only columns of this rows?
thank you!!!

Labels (4)
4 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @Kakurin_Denis ,

Which are your actual bar chart dimension and measure?

Kakurin_Denis
Contributor
Contributor
Author

I have 2 dimensions: RULESET and FRAUD_RISK_ZONE.

measure is COUNT(Aggr(distinct MAX(SCORE_DATE, MONTH, INN_NUM))).

agigliotti
Partner - Champion
Partner - Champion

could you post a sample app with mock data to take a look at?

mato32188
Specialist
Specialist

Hi Denis,

what if you try to use set analysis script to tweak your expression?

count (  {< SCORE_DATE = {"$(=Aggr(distinct MAX(SCORE_DATE, MONTH, INN_NUM)))"}  >} xxxx)

BR

m

ECG line chart is the most important visualization in your life.