Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
andyrebs
Contributor III
Contributor III

Expression to know the mix product

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.

  1. Sheet 1 : customer details
  2. Sheet 2: order details
  3. Sheet 3 : product details

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

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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

View solution in original post

13 Replies
Not applicable

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)

Not applicable

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.

Not applicable

This is nice for aggregation functions. But how would you display a list of Products / Families in this way?

Not applicable

the unique products would be your dimension and you would have the added benefit of seeing a distribution which can be diplayed or graphed.

Not applicable

Can you provide a quick demo application based on the attached sheet?

swuehl
MVP
MVP

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

andyrebs
Contributor III
Contributor III
Author

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

swuehl
MVP
MVP

I am not sure I understand: you want to display a ration, but a ratio defined by what?

andyrebs
Contributor III
Contributor III
Author

by the total of the expression.

Something like, sum(Value)/sum(total(Value))