Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

julesjohnson
New Contributor II

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])

1 Solution

Accepted Solutions
MVP
MVP

Re: Maxstring in Set Notation

May be you need this

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

2 Replies
MVP
MVP

Re: Maxstring in Set Notation

May be you need this

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

julesjohnson
New Contributor II

Re: Maxstring in Set Notation

Wow, that worked!!

Thanks Sunny