Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
shs21
Contributor II
Contributor II

permutation

so you will have all permutations of two items based on the invoice number (use month-year if the conditional probability looks weird with invoice number)

 

e.g.

 

Invoice No. 233, Milk and Egg

Invoice No. 234, Egg and Milk

Invoice No. 235, Egg and Milk

 

Given Egg, what is the probability of Milk?

 

For this to happen I think you need to play with the load script to generate the permutations

how can I

achieve these

Labels (1)
5 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If your product list is really that well structured with " and " you can parse out the individual products with SubField:

Load *,
  SubField(Products, ' and ') as Product
Inline [
Invoice, Products
Invoice No. 233, Milk and Egg
Invoice No. 234, Egg and Milk
Invoice No. 235, Egg and Milk
Invoice No. 236, Egg
Invoice No. 237, Egg and Milk and Bananna
];

You can then calculate the product counts and ratios using that data. 

-Rob

shs21
Contributor II
Contributor II
Author

It it just example in my model many invoce and product

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There is no limit on numbers of Invoices or Products in the solution I proposed. The only limitation I questioned was the actual format of the Products list. 

-Rob

shs21
Contributor II
Contributor II
Author

why we use inline load ?? in my dashboard one column for invoice no and other is product_name so for each invoice  no of product like for 1 invoice there are 2 ,3 , 4 on products so i want conditional probability ...

Eg. if inv no 1 has product 1. 2. 3
then whats probability of 1 given 2 , 1 given 3 , 2 given 1 , 2 given 3, 3 given 1 , 3 given 2

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I was using Inline load only to demonstrate with data. The Load Inline has nothing to do with the proposed solution was to use Subfield() function in the load script to break product_name down into individual products. SubField() is not available as a chart function, so you would need to do this preprocessing in the script. 

Once you have the individual products you still need to do the arithmetic to calculate probability, but it will be easier.

-Rob