Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am attempting to create a expression to sum total quantity for top N in list. I have attempted to use the Rank, Aggr, Presentation Max Number setting and I am not having any luck. Any suggestions and/or assistance would greatly be appreciated. (see attached .QVW with sample data detail and expected results)
Regards,
Ron
Hi.
You can use set analysis with rank, but you'll need some key field to perform this (I've used PDate as it's different for eachrow).
For top 5 sum:
=sum({$<PDATE={"=Rank(total sum(PQTY))<=5"}>}PQTY)
Hi.
I used the whiteline expression and I made a little change.
The expression
=sum( {<PCODE= p({$<PCODE={"=Rank(sum(PQTY))<=5"}>}) >} PQTY)
show the sum for the 5 tops PCODE.
Alessandro Furtado
Dear Rasark,
Please find the attachment of application let me know.
Regards
Hello All,
The Whiteline approach would work great (Thanks) if I was looking to rank QTY, but the requirement is to rank/sort the PDATE and sum the QTY by Top N
Sort/Rank the date in descending order for the current selection and sum the QTY for the Top N. The repsonse Shaik submitted was close, but the RowNos were loaded via script and the production load will be over 150,000k rows...
Thanks,
Ron
Sort/Rank the date in descending order for the current selection and sum the QTY for the Top N.
I think it's even easier:
=sum({$<PDATE={"=Rank(total ONLY(PDATE))<=5"}>}PQTY)