Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Subtotal with conditions

Hi there,

I would like to calculate the percentage of only one row (see example).

the conditions would be something like this:  Sum (Sales) / Sum (Total Sales) if Brand = A

Example:

 

BrandSales
A420%
B5
C11
20

How to you write this ecuation?

Thanks,

Roberto

2 Replies

Re: Subtotal with conditions

Hi,

Try this.

Sum({<Brand = {"A"}>}Sales) / Sum(Total Sales)

Regards,

Kaushik Solanki

jolivares
Valued Contributor

Re: Subtotal with conditions

You have two way:

1. Sum(If(Brand='A',Sum(Sales)/Sum(Total Sales))

2. Sum({<Brand={'A'}>} Sales)/Sum(Total Sales))

I prefer the second one...