Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I created a textbox which returns me the max price of my products
this is my database
Product | Price |
---|---|
A | 1000 |
B | 500 |
C | 100 |
D | 1000 |
E | 1000 |
F | 600 |
G | 1000 |
H | 1000 |
I | 1000 |
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:
Product | Price |
---|---|
A | 1000 |
D | 1000 |
E | 1000 |
G | 1000 |
H | 1000 |
I | 1000 |
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?
OK.
Why A,D,E and not G,H,I ?
Do you want a table ?
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 )))
I dont actually care if its A, D, E or G, H ,I. I wrote it in the alphabatic order. I dont want a table, it just should return the max price and 3 corrospondending products
its . working ! thank you !
Great thanhphongle
Hope I helped you
You could try this expression too:
I removed all your aggr that are not necessary
='Max Price ' & '\n' &
Left(Concat(DISTINCT {<Price = {$(=max(Price))}>} Product, ', '),Index(Concat(DISTINCT {<Price = {$(=max(Price))}>} Product, ', '), ', ', 3))
& ' ...' & '\n '
& money(Max([Price]))