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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count records with max date (over ID)

Hello everyone,


I have the following data:

ID Date DateType
101.05.2018Special
110.03.2018General
212.04.2018Special
206.09.2018Special
216.01.2018Special
325.10.2018General
303.03.2018Special

The task is to draw the chart with date dimension and expression like:

Count(DISTINCT {%DateType={'Special'}>} ID). But need to display only max(date) for ID.


So, desired result:

IDDateDateType
101.05.2018Special
206.09.2018Special
303.03.2018Special


How can i achieve this?

tnx in advance.

3 Replies
mtucholski
Creator
Creator

Hello, try this calculated dimension:

aggr(max({<DataType={Special}>} Date),ID)

mtucholski
Creator
Creator

Sorry, it should be like that:

=if(DataType='Special',aggr(max({<DataType={Special}>} Date),ID),Null())

and suppress null values.

Przechwytywanie.JPG

sunny_talwar

Have you tried using Max(Date) where %DataType is Special as your expression?

Date(Max({%DateType={'Special'}>} Date)