Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sahibakaur
New Contributor II

Calculate Subtotal and Grand total

hi Team,

I have a list of States in counties X and Y and their respective sales:

Country     State          Sales 2018

   X                 A                    100

   X                 B                    200

   X                 C                    250

   X                 D                    50

   Y                 E                    400

   Y                 F                    150

Now, in qlik sense if I select any State: for example A. Then the output table should show the sum of States as well as the sum of nation. The output should be:

State             Sales 2018

A                     100

All States         600

All Country      1150

Please help..

1 Solution

Accepted Solutions
MVP
MVP

Re: Calculate Subtotal and Grand total

In a KPI object? You can try this

1) State A -> Sum(Sales)

2) All States -> Sum({<State, Country = p(Country)>} Sales)

2) All Country -> Sum({<State, Country>} Sales)

4 Replies
MVP
MVP

Re: Calculate Subtotal and Grand total

In a KPI object? You can try this

1) State A -> Sum(Sales)

2) All States -> Sum({<State, Country = p(Country)>} Sales)

2) All Country -> Sum({<State, Country>} Sales)

ogautier62
Valued Contributor II

Re: Calculate Subtotal and Grand total

Hi,

- for all states of same same country as selection :

set analysis like :   sum( {<State = P({$})            >} sales)

  you'll have states matching with state of your selection

- for all countries :

sum( {1} sales)

regards

ogautier62
Valued Contributor II

Re: Calculate Subtotal and Grand total

  sum( {<country = P({$})        >} sales)

correction

sahibakaur
New Contributor II

Re: Calculate Subtotal and Grand total

Thank you Sunny and Olivier for the answers. It really helped

Community Browser