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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get the field that linl tothe max value

Hi,

I have variable in the UI that present the max value of deposit.

max(DepositAmount) - this value appears in the text box object.

I want to show in the text box not only the amount it self but also  the name of the customer.

In other words, I wondering if there is a function that returns fields that link to the max value like customer name/country and etc.

Hope it's clear what I asking 😕

1 Solution

Accepted Solutions
stabben23
Partner - Master
Partner - Master

If you have many Customer/Country which have the same DepositeAmount, use

concat({<DepositAmount={"$(=max(DepositAmount))"}>}Customer,'|') to get all  separated With a | sign, otherwise you will get a - (null value)

View solution in original post

7 Replies
stabben23
Partner - Master
Partner - Master

Hi,

maybe there is better solutions, but I normally use setanalysis for this.

Try With only({<DepositAmount={"$(=max(DepositAmount))"}>}Customer)

stabben23
Partner - Master
Partner - Master

If you have many Customer/Country which have the same DepositeAmount, use

concat({<DepositAmount={"$(=max(DepositAmount))"}>}Customer,'|') to get all  separated With a | sign, otherwise you will get a - (null value)

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Also, I would add a predicate DISTINCT

=Concat(Distinct {<

  Sum = {"$(=max(Sum))"}

>}Customer, ', ')

In case you have duplicates like in 4th and 5th rows of the code:

LOAD * INLINE [

    Customer, Sum

    A, 1

    B, 4

    B, 4

    C, 3

    C, 4

];

Result would be only B, C

stabben23
Partner - Master
Partner - Master

Yes thats correct if he use Customer from the fact table, but i'm pretty sure that he have a dimesion table which contain the distinct customer, but if I'm wrong Distinct predicate is needed.

Not applicable
Author

Hi David,

As for my understanding

='Name:       '&concat({<DepositAmount={"$(=max(DepositAmount))"}>}customer,'|') & Chr(13)&            

'value:          '&Aggr(max(DepositAmount),customer)&

Not applicable
Author

Hi

David can you try this one

=concat({<Amount={"$(=max(Amount))"}>}Name,'|') & ' ,'&max(Amount)

Anonymous
Not applicable
Author

Thanks it work