Qlik Community

Ask a Question

App Development

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

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
anellibridge
Partner
Partner

Count Objects for Max Date in Set Analysis

Hello,

I have a table showing Category Code, Sales Date, and Objects:

TESTA.JPG


I want to calculate for each Category Code the quantity of distinct Objects that have the max Sales Date for each Category Code:
TESTB.JPG

In this example for the Category Code=1, I want that #Objects=2 because there are 2 distinct Objects that have the Sales Date 18/12/2017.

I'm using the Version November 2017 of Qlik Sense.

Any suggestion?

thx a lot,

Arianna

11 Replies
justinphamvn
Creator II
Creator II

Hi Arianna

Try this: FirstSortedValue(aggr(Count( distinct Objects),[Sales Date] ), -[Sales Date] )

I hope this helps.

Thank you!

Justin

anellibridge
Partner
Partner
Author

Hi Hector,

thank u a lot for your reply, but it doesn't function that formula.

After a lot of test I found the solution!

Count( Distinct If(Aggr(NODISTINCT Max( TOTAL <[Category Code]> [Sales Date]),[Category Code],[Object]) = [Sales Date], [Object]))


Thanks a lot to everyone,

View solution in original post