Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Jeff2022
Contributor II
Contributor II

how to add addtional row(total value) in table

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

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

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.

View solution in original post

1 Reply
Or
MVP
MVP

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.