Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

d_ankusha
Contributor 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
MVP
MVP

Re: Group By

Is this what you are looking for?

LOAD

     material,

     business_name,

     sum(total_expense) as sum_total_expense

FROM ...

Group By material, business_name;

5 Replies
MVP
MVP

Re: Group By

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.

d_ankusha
Contributor II

Re: Group By

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

nivethitha
New Contributor II

Re: Group By

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;

MVP
MVP

Re: Group By

Is this what you are looking for?

LOAD

     material,

     business_name,

     sum(total_expense) as sum_total_expense

FROM ...

Group By material, business_name;

d_ankusha
Contributor II

Re: Group By

YES, Thanks