Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I would have an expression in a chart, that can let me know what else custumers buy when they buy a specific product.
I attached for you perusal an excel file with three sheets.
Is it possible to select a Family and view what else, the custumers those buy the selected family , buy.
I hope you can help me.
Thanks
Andrea
As I've understood the OP's request, he wants to filter the Companies to see only the ones that have ever bought a product of the selected family type.
If you use something like
=count({<family=> value)
you will clear the selection in family for this expression, so if you use this as expression in a chart table, and you have made a selection in field family, you will essentially address all records for your calculation.
I don't think this will result in something the OP wants to see, it does not filter the Companies that have ever bought a product from family selected.
To achieve this, you need to tell QV to implicitely select those Companies, that have a relation with the selected family. Then you need to clear the selection in family, to allow one to see all products bought by those Companies.
You can use a implicite field value definition using the p() function for this:
=count({<Company = p(), Family= >} [Order N°])
Using this in a chart with dimension Company and Product desc, you will see only the Companies that ever bought products from the selected family, but you will see all products they bought.
See also attached.
Stefan
Create another Table within your load scirpt:
OtherProductOrders:
LOAD [Order N°],
[Cod. Product] as OtherProductCode
Resident Orders;
INNER JOIN
LOAD [Cod. Product] as OtherProductCode,
[Desc. Product] as OtherProductDescr,
Family as OtherFamily
Resident Products;
Then you can display i.e. OtherFamily in a listbox or diagram.
(Change "Orders" and "Products" to appropriate table names in your script)
the trick here is to use set analysis to exclude the family selection.
Place products as your dimension.
add an expression to eliminate family ie count({<family=> value)
This will effectively give you the count of all products bought by someone in a particular family.
This is nice for aggregation functions. But how would you display a list of Products / Families in this way?
the unique products would be your dimension and you would have the added benefit of seeing a distribution which can be diplayed or graphed.
Can you provide a quick demo application based on the attached sheet?
As I've understood the OP's request, he wants to filter the Companies to see only the ones that have ever bought a product of the selected family type.
If you use something like
=count({<family=> value)
you will clear the selection in family for this expression, so if you use this as expression in a chart table, and you have made a selection in field family, you will essentially address all records for your calculation.
I don't think this will result in something the OP wants to see, it does not filter the Companies that have ever bought a product from family selected.
To achieve this, you need to tell QV to implicitely select those Companies, that have a relation with the selected family. Then you need to clear the selection in family, to allow one to see all products bought by those Companies.
You can use a implicite field value definition using the p() function for this:
=count({<Company = p(), Family= >} [Order N°])
Using this in a chart with dimension Company and Product desc, you will see only the Companies that ever bought products from the selected family, but you will see all products they bought.
See also attached.
Stefan
Hi,
I am sorry for the delay. Stefan, you have understood. I tried your expression and it works.
Do you know which is the best way to view this kind of Analysis? Maybe a particular chart or graph or something else.
I need to ask another question, Which is the per cent version of your expression, how I can convert your expression in percentage?
Many many thanks
Andrea
I am not sure I understand: you want to display a ration, but a ratio defined by what?
by the total of the expression.
Something like, sum(Value)/sum(total(Value))