Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Table (see attached image) and a KPI (image attached). I want two measures in my KPI, one which displays the calculated Age of the oldest work order in the table and the second to display the work order number of that work order. I read a solution to a similar problem where the solution referred to one column of a table to grab another column in the same row: =Only({<ID={1}>} value). What I tried is =Only({<Days={'=max(Days)'}>} Work_Order_Number) and that didn't work.
So is this even possible? If so, what am I missing? It seems like my set expression should work, but then I have a lot to learn about Qlik too.
Appreciate any suggestions!
Hi @aschmeelk
Try with Firstsortedvalue, something like
=FirstSortedValue(Distinct Work_Order_Number, -Aggr(Only({<ID={1}>} value), Work_Order_Number))
Hi @aschmeelk
Try with Firstsortedvalue, something like
=FirstSortedValue(Distinct Work_Order_Number, -Aggr(Only({<ID={1}>} value), Work_Order_Number))
First, thank you for your response, Mayil!
Regarding the above suggested set expression: =FirstSortedValue(Distinct Work_Order_Number, -Aggr(Only({<ID={1}>} value), Work_Order_Number))
Question:
Is the '-' in front of the Aggr() intentional and if so, what does it signify?
Hi @aschmeelk
Please refer the below link for more detail about firstsortedvalue function
If you place a minus sign in front of aggr function (Sort_weight), the function returns the highest sorted value.
Ah! thank you.