Skip to main content
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])

1 Solution

Accepted Solutions
sunny_talwar

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

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