Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dears
I met a question in writing script in Qliksense like from Table1 into Table2.
How to add "Total" row by fruit type ,Month,and Customer in Table1.
who can help ? Thank you so much.
1,Table1
Customer | Month | Fruit_type | Sales_volume |
A | jan | organge | 100 |
A | Jan | apple | 101 |
A | Jan | bear | 102 |
B | Feb | organge | 103 |
B | Feb | apple | 104 |
B | Feb | bear | 105 |
A | Mar | organge | 106 |
2,Table2
Customer | Month | Fruit_type | Sales_volume |
A | jan | organge | 100 |
A | Jan | apple | 101 |
A | Jan | bear | 102 |
B | Feb | organge | 103 |
B | Feb | apple | 104 |
B | Feb | bear | 105 |
A | Mar | organge | 106 |
A | Jan | Total | 303 |
B | Feb | Total | 312 |
A | Mar | Total | 106 |
Best Regards
Jeff
Load Customer, Month, Fruit_Type, Sales_volume
From Table1;
CONCATENATE
Load Customer, Month, 'Total' as Fruit_type, sum(Sales_volume) as Sales_volume
From Table1
Group by Customer, Month;
Keep in mind this will result in duplication if at any point in your front-end you sum these lines, since the total lines are inserted into the actual data.
Load Customer, Month, Fruit_Type, Sales_volume
From Table1;
CONCATENATE
Load Customer, Month, 'Total' as Fruit_type, sum(Sales_volume) as Sales_volume
From Table1
Group by Customer, Month;
Keep in mind this will result in duplication if at any point in your front-end you sum these lines, since the total lines are inserted into the actual data.