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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
julesjohnson
Contributor III
Contributor III

Maxstring in Set Notation

Hello Everyone,

I am using the following statement to return the highest dollar amount of the ticket with a status of *open*, and a request type of *Incident* and it works just fine. 

=Num(MaxString({$<[Request Type_S]={'*Incident*'},[Request Status_S]={'*open*'}>
}
[CM_Cost/Hr]*[Elapsed_Time_S]),'$#,##0')

Now I want a statement that returns the corresponding “Request ID”.  I have this statement so far but need to also include where the dollar amount is maxstring (CM_Cost/Hr]*[Elapsed_Time_S]). Is there a way I can do this?

  =only({$ <[Request Type_S]={'*Incident*'},[Request Status_S]={'*open*'}>
}
[Request ID_S])

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be you need this

=FirstSortedValue({$<[Request Type_S] = {'*Incident*'}, [Request Status_S] = {'*open*'}>} [Request ID_S], -[CM_Cost/Hr] * [Elapsed_Time_S])

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

May be you need this

=FirstSortedValue({$<[Request Type_S] = {'*Incident*'}, [Request Status_S] = {'*open*'}>} [Request ID_S], -[CM_Cost/Hr] * [Elapsed_Time_S])

julesjohnson
Contributor III
Contributor III
Author

Wow, that worked!!

Thanks Sunny