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

count based on latest date

Hello guys , 

i need to make a count ID and by status based on  Max date 

Also how i get the status for the latest date 
Maxdate is expression i wrote :  =aggr( max(UDATED),OBJNR)  .  how to put that count in charts 

Zahmed14_0-1610821496814.png

 

Labels (2)
1 Solution

Accepted Solutions
Ksrinivasan
Specialist
Specialist

hi,

1. you have to create variable to get  Latest Date as below

Ksrinivasan_0-1610869601575.png

2. we will Call the Variable in in pie chart

1. DIM=STATUS

2. MEASURE=count({$<MAXDATE = {'$(=vMaxdate)'}>}COUNT_ID)

result as below:

Ksrinivasan_1-1610869768761.png

ksrinivasan.

View solution in original post

12 Replies
Ksrinivasan
Specialist
Specialist

hi,

you can use Straight table,

DIMENSIONS are 1. MAXDATE, 2. STATUS

MEASURES is 1. Count(ID)

Ksrinivasan_0-1610827725884.png

ksrinivasan

 

Zahmed14
Contributor III
Contributor III
Author

how can i put this count in chart or  KPI componant  counting by status type

How to get the latest status  for every ID

Ksrinivasan
Specialist
Specialist

hi,

1. you have to create variable to get  Latest Date as below

Ksrinivasan_0-1610869601575.png

2. we will Call the Variable in in pie chart

1. DIM=STATUS

2. MEASURE=count({$<MAXDATE = {'$(=vMaxdate)'}>}COUNT_ID)

result as below:

Ksrinivasan_1-1610869768761.png

ksrinivasan.

Zahmed14
Contributor III
Contributor III
Author

thats good but  " MAXDATE " was experssion in table i wrote  ... so it gives me error when i write it in the variable of VMax_date

Ksrinivasan
Specialist
Specialist

hi, no need to maintain separate MAXDATE expression for table.

you can use same  Variable: vMaxdate =MAX(MAXDATE) for both Table and Chart as Expression and DIM also.

as below 

Ksrinivasan_0-1610875368364.png

ksrinivasan.

Zahmed14
Contributor III
Contributor III
Author

I mean the MAXDATE in blue circle   

Zahmed14_0-1610876352716.png

 

Ksrinivasan
Specialist
Specialist

hi,

what you have marked blue box value is field name, its from your table last field.

its not considered here as dimension , expression and formula.

ksrinivasan.

Zahmed14
Contributor III
Contributor III
Author

No thats what am trying to say .  the blue field is an expresion i wrote in my table  not a field name coming from source  i just wore this exp in table  "=aggr( max(UDATED),OBJNR) " to get the blue field 

so it will not appear when i create my variable    

Zahmed14
Contributor III
Contributor III
Author

how to get latest status for ID  in chart or table ?