Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a database output like below. And I got same output in to Qlik via SQL query.
Customer | Item | Quantity |
10001 | Milk | 10 |
10002 | Milk | 8 |
10001 | Eggs | 4 |
10002 | Eggs | 4 |
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
Customer | Total Quantity | Milk Quan | Eggs Quan |
10001 | 14 | 10 | 4 |
10002 | 12 | 8 | 2 |
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.
use pivot table , this will help you to get the desired format. Pivoting on the item column
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.
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
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.
@Hi muralidhar
Plz find the attached
Thank you all.Great communuty and helping us to learn Qlik with light speed.