Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

peter_thornton
New Contributor III

Using set analysis to generate a percentage

I'm trying to calculate what percentage of customers spending over a certain level have bought products from us.

Using this syntax I can count the number of customers spending more than £1000 based on my current selection (which is fine).

=count({$<location_id={"=sum(customer_gross_sales)>1000"} >} location_id)

I can use the same syntax to say how many customers spending more than £1000 are buying each product.

What I don't know how to do is get the count of the total number of customers spending more than £1000 and use it to divide the number of customers spending more than £1000 on each product by?

Do I need to use a variable?

1 Solution

Accepted Solutions
vgutkovsky
Honored Contributor II

Re: Using set analysis to generate a percentage

You just need the word "total" in your denominator, assuming that product is the dimension of your chart.

count({<location_id={"=sum(customer_gross_sales)>1000"} >} location_id)

/

count({<location_id={"=sum(customer_gross_sales)>1000"} >} total location_id)

If you have other dimensions in the chart, then you would need <> brackets after the word total and include all dimensions in there except for Product. For example, total <Country,Date>

Regards,

Vlad

2 Replies
vgutkovsky
Honored Contributor II

Re: Using set analysis to generate a percentage

You just need the word "total" in your denominator, assuming that product is the dimension of your chart.

count({<location_id={"=sum(customer_gross_sales)>1000"} >} location_id)

/

count({<location_id={"=sum(customer_gross_sales)>1000"} >} total location_id)

If you have other dimensions in the chart, then you would need <> brackets after the word total and include all dimensions in there except for Product. For example, total <Country,Date>

Regards,

Vlad

peter_thornton
New Contributor III

Re: Using set analysis to generate a percentage

Thanks Vlad. That's exactly what I needed to do. I want to evolve this to be able to show the product penetration over time but that can wait until another iteration.

Thanks very much for your help

Community Browser