Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a database consisting of two tables linked by Invoice No (similar to the below). I would like to create a calculated dimension in a straight table to display all the Product for the top 100 customers based on their sales?
Thanks for your time,
Matthew
Table 1 |
---|
Invoice No |
Customer |
Table 2 |
---|
Invoice No |
Product |
Sales $ |
Hello, Matthew.
I was able to solve your problem not with Calculated Dimensions but with Set Analysis. Use Product as the dimension and model your expressions like this one:
Sum({$<Product = P({1<Customer = {'$(=Concat(Aggr(If(Rank(Sum([Sales $])) <= 100, Customer), Customer), Chr(39)&','&Chr(39)))'}>} Product)>} [Sales $])
Attached is the QVW.
Cheers.
Hello, Mattew.
Try this as your calculated dimension:
=Aggr(If(Rank(Sum([Sales $])) <= 100, Product), Customer)
Regards.
Hi Bruno,
Thanks for the reply, unfortunately that returned a null value.
I am currently using the below formula to display the top 100 customers, basically I want the dimension to display all the products that the customers calculated with the below formula purchased. But I am not sure how to expand the formula to achieve this.
=aggr(if(rank(sum([Sales $]))<=100,Customer),Customer)
Regards,
Matthew
can you attach a sample qvw please?
Hi,
Sample qvw attached.
Regards,
Matthew
Hello, Matthew.
I was able to solve your problem not with Calculated Dimensions but with Set Analysis. Use Product as the dimension and model your expressions like this one:
Sum({$<Product = P({1<Customer = {'$(=Concat(Aggr(If(Rank(Sum([Sales $])) <= 100, Customer), Customer), Chr(39)&','&Chr(39)))'}>} Product)>} [Sales $])
Attached is the QVW.
Cheers.
Have you considered using dimension limits instead of a calc dimension?
-Rob
Hi Bruno,
Thanks for your help this did the trick.
Kind Regards,
Matthew
Hi Rob,
No, I haven't looked into dimension limits too much, but I will keep this in mind in future.
Kind Regards,
Matthew
I recommend you check out Dimension Limits. It's a lot easier than Set Analysis or Calculated Dimensions. It's right there in the QV11 chart properties next to the Dimensions pane.
-Rob