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

Totals by Dimensions

I have a database output like below. And I got same output in to Qlik via SQL query.

 

CustomerItemQuantity
10001Milk10
10002Milk8
10001Eggs4
10002Eggs4

My desired output is below. I would like to do this via Qlik. Or I would like to compute Total qunatity, Milk qnt, and Eggs qnt via Qlik Expressions. Is it possible? Please help

 

CustomerTotal QuantityMilk QuanEggs Quan
1000114104
100021282
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Straight table.

Dimension: Customer

Exp1: Sum(Quantity)

Exp2: Sum({<Item={'Milk'}>}Quantity)

Exp3: Sum({<Item={'Eggs'}>}Quantity)

Or, if you have many Items, you could do it dynamically using pivot table enabling partial sum (for total) in the presentation tab.

View solution in original post

6 Replies
avinashelite

use pivot table , this will help you to get the desired format. Pivoting on the item column

tresesco
MVP
MVP

Straight table.

Dimension: Customer

Exp1: Sum(Quantity)

Exp2: Sum({<Item={'Milk'}>}Quantity)

Exp3: Sum({<Item={'Eggs'}>}Quantity)

Or, if you have many Items, you could do it dynamically using pivot table enabling partial sum (for total) in the presentation tab.

Anonymous
Not applicable
Author

Hi

Add Custoimer as dimension and below 3 expressions in your chart

for Total Quantity= sum(Quantity)

Milk Quantity = sum({<Item={'Milk'}>}Quantity)

Eggs Quantity  = sum({<Item={'Eggs'}>}Quantity)

Regards,

Greeshma

jagan
Luminary Alumni
Luminary Alumni

Hi Murali,

I think Pivot table is the best option

Dimension: Customer, Item

Expression: Sum(Quantity)

Enable Partial total in presentation mode

and drag the Item dimension to top.

Regards,

Jagan.

sunilkumarqv
Specialist II
Specialist II

@Hi muralidhar

Plz find the attached

Not applicable
Author

Thank you all.Great communuty and helping us to learn Qlik with light speed.