Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I have sample data in QlikView such as bellow:
LOAD * INLINE [
CustomerName, ProductTitle, Fee, Quantity, Price
A1,Book1,100,7,700
A1,Book2,200,5,1000
B1,Book1,100,3,300
B1,Book2,200,6,1200
C1,Book1,100,9,900
C1,Book2,200,9,1800
D1,Book1,100,4,400
D1,Book2,200,5,1000
E1,Book1,100,6,600
E1,Book2,200,6,1200
F1,Book1,100,12,1200
F1,Book2,200,9,1800
];
I want calculate rank of customer for a specific product.
for example:
Rank of customer "E1" in product "Book1" is 4.
Because:
F1 -> Book1 -> 1200
C1 -> Book1 -> 900
A1 -> Book1 -> 700
E1 -> Book1 -> 600
D1 -> Book1 -> 400
B1 -> Book1 -> 300
As per input from Babaei, Criteria is price of the Product, grouped by Title and Customer.
If we take book1 price, then E will come at 4 rank.
may be this
aggr(rank(sum(Price)) ,ProductTitle,CustomerName)
Rank of customer "E1" in product "Book1" is 4?? What's the criteria for ranking?
Thank you!
As per input from Babaei, Criteria is price of the Product, grouped by Title and Customer.
If we take book1 price, then E will come at 4 rank.
Thank you
Welcome
Thank you.
It solved.
just a question.
For some customer rank display for example 3-5, how can i display upper band. it means instead of 3-5 display 5?
Thank you.
It solved.
just a question.
For some customer rank display for example 3-5, how can i display lower band. it means instead of 3-5 display 3?
I solved that.
I should use this in rank function:
aggr(rank(sum(Price),0,1) ,ProductTitle,CustomerName)
You are a star Please close the thread