Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dimension
PartNumber
Expression
FirstSortedValue(Price,-InvoiceDate)
1) Giving me '-' whenever same part number is sold more than once on the same date.
2) What if same part number is sold more than once with different price
My Idea is to get Minimum Price for each part number sold on the latest Date...
How about:
=FirstSortedValue(DISTINCT Aggr(Min(Price),PartNumber,InvoiceDate),-InvoiceDate)
-Rob
It works, but I don't understand why
So after a very hard and tired day, I got some useful solutions.
Jerem
SubField(CONCAT(Aggr(MIN(Price),PartNumber,InvoiceDate),'|',-InvoiceDate),'|',1)
B Aydin
Min(If(InvoiceDate = Aggr(NODISTINCT Max(InvoiceDate), PartNumber), Price))
Would appreciate if you explain to understand the use of NODISTINCT in this expression...
Rob
FirstSortedValue(DISTINCT Aggr(Min(Price),PartNumber,InvoiceDate),-InvoiceDate)
Hi Rob, What is the reason of getting syntex error (red lines) in expression?
Whiteline
FirstSortedValue(Aggr(Min(Price),PartNumber,InvoiceDate),-Aggr(InvoiceDate, PartNumber, InvoiceDate))
Can anyone try to explain how above expression is working? Want to understand the magic behind two InvoiceDate in single Aggr.
Thanks all for your support.
"... Hi Rob, What is the reason of getting syntax error (red lines) in expression?"
DISTINCT appeared in the doc some time back (I think an early QV10 SR) but the syntax checker was never updated. (or may have worked for a while -- can't recall). The red squiggle is probably why most people don't know about DISTINCT in FirstSortedValue . Welcome to the club.
-Rob
Thanks ROB....