- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Get First document with min and max price by product
Hello collegues!
I am begginer in QV practice, I will apreciate if anybody give me an advise for resolving this case:
I have a pivot table with diferent products with diferent prices in various documents or invoices. Ok, then I want to get the fist invoice or document with the minimum price and other result on top column get the fist invoice or document with the maximum price by product.
Example: According my e.g., I must to get:
Product MinPrice MaxPrice MinDocument MaxDocument
Product A 2 4 77 33
Product B 2 5 44 22
Product C 7 9 77 55
I applied the next funtion and other relatives at FirstValue for instance:
FirstSortedValue(DOCUMENT,Aggr(Count(PRODUCT), DOCUMENT))
But i have not good results Could you help me please? I attach the QVW.
I appreciate your advises!
Thanks everybody for advance!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Exp1: =Min(PRICE)
Exp2: =Max(PRICE)
Exp3: =FirstSortedValue(DISTINCT DOCUMENT, PRICE)
Exp4: =FirstSortedValue(DISTINCT DOCUMENT, -PRICE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Exp1: =Min(PRICE)
Exp2: =Max(PRICE)
Exp3: =FirstSortedValue(DISTINCT DOCUMENT, PRICE)
Exp4: =FirstSortedValue(DISTINCT DOCUMENT, -PRICE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thks a lot dear Sunny T.
I appreciate your help! I am gointo to implement the solution in real case right now!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Real scenarios are usually much more difficult than samples. So in case you have any trouble you can always come back to the community and someone will be more than happy to help you out.
Cheers,
Sunny