# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
Contributor II

## Results for top selling customer only

Hi All,

I am after some advice on how to show the name and sales for the top selling customer only in a straight table.

As shown in the example below, I am trying to find the correct expression to be applied.

 Product Total Sales Top Selling Customer Name Top Selling Customer Sales A \$7,140,094 B \$534,855 C \$3,830,149 D \$2,178,790 E \$427,070 F \$1,431,438 G \$369,771 H \$411,258 I \$274,445 J \$112,001 K \$72,054

1 Solution

Accepted Solutions
Master

Top Selling Customer Name

=FirstSortedValue(Product,-[Total Sales])

Top Selling Customer Sales

=FirstSortedValue([Total Sales],-[Total Sales])

3 Replies
Master

Something like this?

``````tab1:
Product, Total Sales , Top Selling Customer Name, Top Selling Customer Sales
A, "\$7,140,094",  ,
B, "\$534,855",  ,
C, "\$3,830,149",  ,
D, "\$2,178,790",  ,
E, "\$427,070",  ,
F, "\$1,431,438",  ,
G, "\$369,771",  ,
H, "\$411,258",  ,
I , "\$274,445",  ,
J, "\$112,001",  ,
K, "\$72,054",
];``````

Master

Top Selling Customer Name

=FirstSortedValue(Product,-[Total Sales])

Top Selling Customer Sales

=FirstSortedValue([Total Sales],-[Total Sales])

Contributor II
Author

Thanks saran7de!

I managed to use the FirstSortedValue expression and it worked a treat, thanks once again!