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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Natgeb
Contributor
Contributor

Qlikview - Count last distinct id with two conditions

I am trying to count the last distinct ID with two conditions in an expression in Qlikview.

I tried with this expression;

 

Max(Aggr (
COUNT ( DISTINCT { < 
VehicleEventCar_Code={'>=12<=19'} 
,Calendar_MonthNumber = {'$(uv_TodayLastMonth)'}  
>}Vehicle_RegisterNumber),VehicleModel_ModelFamilyName),VehicleEventCar_Code) 

 

But it gives me the distinct count of Vehicle RegisterNumber in VehicleEventCar Code 12-19, however a car can be in that status and later in the month be in a higher status like 20.

If it makes sense I only want to get a distinct count of Vehicle RegisterNumber if the last VehicleEventCar Code status is between 12-19, during calendar month = TodaylastMonth and aggr on VehicleModel_ModelFamilyName

Can anyone see what I am doing wrong?

Labels (1)
0 Replies