Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhphongle
Creator II
Creator II

giving out a certain number of values

Hello Community,

I created a textbox which returns me the max price of my products

this is my database

ProductPrice
A1000
B500
C100
D1000
E1000
F600
G1000
H1000
I1000

this is my expression:

='Max Price ' & '\n' &

Concat(DISTINCT {<Product = {"=Aggr(max(Price), Product) = Max(TOTAL Aggr(max(Price), Product))"}>} Product, ', ') & ' ...' & '\n '

& money(Max(TOTAL Aggr(Max([Price]),Product )))

QV returns me:

ProductPrice
A1000
D1000
E1000
G1000
H1000
I1000

This is definetly correct.

But what I want is, that QV should return me max 3 values. Something like:

A = 1000

D = 1000

E = 1000 etc. ...

is this possible?

1 Solution

Accepted Solutions
sunny_talwar

You can try this:

='Max Price ' & '\n' &

FirstSortedValue(Product, -Aggr(Max(Price), Product) + Ord(Left(Product, 1))) & ' ,' &

FirstSortedValue(Product, -Aggr(Max(Price), Product) + Ord(Left(Product, 1)), 2) & ' ,' &

FirstSortedValue(Product, -Aggr(Max(Price), Product) + Ord(Left(Product, 1)), 3) & ' ,'

& ' ...' & '\n '

& money(Max(TOTAL Aggr(Max([Price]),Product )))

View solution in original post

15 Replies
sunny_talwar

Max 3 values? Not sure I understand completely?

Chanty4u
MVP
MVP

try this

=Max(field,3)

Anonymous
Not applicable

what condition you want to follow as 6 products have proce of 1000?

by alphabetic?

did you look at tab dimension Limits?

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Hi:

Open the properties window of your straight table and set up this dimension limits

Captura.JPG

Hope it helps

Joaquín

thanhphongle
Creator II
Creator II
Author

I didnt create the expression in a chart. I use this expression in the textbox.

Anonymous
Not applicable

nevertheless look at source data

create tablebox or listboxes to checkthe origin data

or provide a sample qvw so we can have a look into

thanhphongle
Creator II
Creator II
Author

I attached a qvw file !

3 largest product in alphabetic order would be great

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Here you have it

thanhphongle
Creator II
Creator II
Author

Sry maybe i didnt explain my problem correctly

QV should return Max Price = 1000 and the correspondending products (3, not all) = A, D, E ...