Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
male_carrasco
Creator
Creator

P() Variable

Hello,

I'm calculating the% of customers who bought the products A and B.

Example:

Count({1<Cliente = P({<Producto = {'A'} >})*P({<Producto = {'B'} >})>}Distinct Cliente)/ Count({1}DISTINCT Cliente)

I need to be a dynamic formula that calculates the% according to selection.

Thank you very much in advance.

Ale.

1 Reply
whiteline
Master II
Master II

Hi.

Since you've used the {1} subset as the basis It's not clear how it should be dynamic.

Depending on your data model you can make it easier selecting the products directly:

Count({<Producto = {'A', 'B'}>} Distinct Cliente)/ Count(DISTINCT Cliente)