Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
morenoju
Partner - Specialist
Partner - Specialist

FirstSortedValue based on two fields

Hi all,

I have some records called "incidents" in my DB and I wanted to get the one with the longest duration. I did this and worked fine:

FirstSortedValue({1<IsPlannedIncident={"0"},EventStatusId={"22"}>} TotalIncidentDuration,-TotalIncidentDuration, 1)

Now I want to use another field called EventImapctId. I want to get the duration of the incident with highest impact, but this is returning a null:

FirstSortedValue({1<IsPlannedIncident={"0"},EventStatusId={"22"}>} TotalIncidentDuration,-EventImpactId, 1)

It's returning a null. Is it maybe because I many incidents with same impact and Qlik Sense doesn't know which one to choose? Is it possible to write the expression so in case of incidents with same impact it takes the one with longest duration?

Thanks,

Juan

0 Replies