Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display the top account name in a Text box

Hi All,

I want to display the Name of the Account with the top Sales number in a text box

i am using the below expression

Top Account = '& If(aggr(rank(sum(sales)),AccountName)<=1,AccountName,null())

But the text box looks blank. what could be the reason?

7 Replies
johnw
Champion III
Champion III

I think this?

='Top Account = ' & concat(aggr(if(rank(sum(sales))=1,AccountName),AccountName),',')

The concat() is there in case the two biggest accounts share the exact same sales. Otherwise you'd get null.

Not applicable
Author

Nope Still list box is still blankSad

johnw
Champion III
Champion III

Works for me. See attached.

Not applicable
Author

Hi John,

Thank you very much for your solution. it worked

Earlier it was not working as i had some rows with no sales number and no Account name. Looks like those rows has some spaces in it as well. i updated the input sheet to put 0 when Sales = 0 and it worked

I have an other question though.

I also have a bar chart that shows the top 10 accounts and i have one account with 3 different sales number and the bar chart is ignoring that account altogether. Any Solution for that

My requirement is to show that account once in my top 10.

johnw
Champion III
Champion III


ynarayan wrote: I also have a bar chart that shows the top 10 accounts and i have one account with 3 different sales number and the bar chart is ignoring that account altogether. Any Solution for that
My requirement is to show that account once in my top 10.




I'm not sure I have enough information about the problem. It could be as simple as needing to use sum(Sales) instead of Sales as your expression, for instance. I assume it's nothing that straightforward. Perhaps post an example?

Not applicable
Author

Dear SIr,

In the above application this also works without concate, then why we are using it ?????

Please provide guidence

aggr(if(rank(sum(sales))=1,AccountName),AccountName)

johnw
Champion III
Champion III


AshwinPagare wrote:In the above application this also works without concate, then why we are using it ?????



John Witherspoon wrote:The concat() is there in case the two biggest accounts share the exact same sales. Otherwise you'd get null.


The example I posted before simply didn't demonstrate this problem and solution. This new example does demonstrate it, showing the difference between using concat() and not using it.