Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
danimarc12
Partner - Creator
Partner - Creator

Association between 2 products

Hello everyone!

I have an issue with an expression. This is my pivot table where I have the dimension reparto in the rows and reparto2 in the columns:

Cattura.PNG

I have used the following expression: count (distinct scontrino) to calculate the number of order with both of the products.

My goal is to display a value which divides this number by the total of order for each product. This total is the number underlined. So I want to display in order:

BARBERIA:        (91/91 ) 100%   |       (1/91) 1.09%       |      (2/91) 2.19%....
DESIGN:             (1/401) 0.25%    |    (401/401) 100%  |     (1/401) 0.25%.....

Could anyone help me to write the correct expression to achieve my goal?

Thank you so much!

Labels (1)
4 Replies
Kushal_Chawda

@danimarc12  try below

count (distinct scontrino) /
count(total <reparto>{<scontrino={"=reparto=reparto2"}>} distinct scontrino)

or

count (distinct scontrino) /
count(distinct total <reparto>if(reparto=reparto2,scontrino))
danimarc12
Partner - Creator
Partner - Creator
Author

Hi @Kushal_Chawda ,

thanks for your answer. It still not working ☹️ This is the result:

Cattura1.PNG

Kushal_Chawda

@danimarc12  which expression you are using. make sure that field names are correct in your expression

danimarc12
Partner - Creator
Partner - Creator
Author

Hi @Kushal_Chawda , I've used both of the expressions.

First expression:

expr1.PNGResult:res1.PNG

 

 

Second Expression:

expr2.PNG

 

Result:

res1.PNG