Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
d_ankusha
Creator II
Creator II

Group By

I have a table with fields like total_expense,material, business_name, etc. Now I want sum(total_expense)  where the first grouping is to be done on the basis of material and then on business_name. How can I do that?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Is this what you are looking for?

LOAD

     material,

     business_name,

     sum(total_expense) as sum_total_expense

FROM ...

Group By material, business_name;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Not sure what you are asking, Do you want to create a chart/table? Then use material and business_name as dimensions and sum(total expense) as the expression/measure.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
d_ankusha
Creator II
Creator II
Author

I don't want to create a chart . I want to do that in the backend (in script).

nivethitha
Partner - Contributor II
Partner - Contributor II

Do you mean that you need to group by on the combination of material and business_name? If so just group by with material and business_name in script,

LOAD

material,

business_name,

sum(total_expense) as expense_total

resident root_table

group by material, business_name;

jonathandienst
Partner - Champion III
Partner - Champion III

Is this what you are looking for?

LOAD

     material,

     business_name,

     sum(total_expense) as sum_total_expense

FROM ...

Group By material, business_name;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
d_ankusha
Creator II
Creator II
Author

YES, Thanks