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

Flag instance with max value

I have a table with several fields that include:

A unique ID

An "Event" ID

A "Time" column with a numeric value for days

-several others

 

I would like to flag, for each "event" ID, the occurrence with the largest value for "Time"

I'm trying the solution suggested by this post      but I've had some issues. At first I couldn't get the MAX() function to work within qlik so I did it through SQL. Now this part works but when I do the join to add the flags, it is added to every line.

Any suggestions to fix this solution or maybe an idea for a different one?

 

Thank you, 

 

Labels (1)
1 Reply
sunny_talwar

May be try like this

Table:
LOAD ID,
Event_ID,
Time,
...
From ...;

Left Join (Table)
LOAD ID,
Max(Time) as Time,
1 as Max_Event
Resident Table
Group By ID;