Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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 (2)
4 Replies
agigliotti
MVP
MVP

Hi @Kakurin_Denis ,

Which are your actual bar chart dimension and measure?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
MVP
MVP

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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.