Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total of two formulas

I would like to have one column (New field) with the total based on a calculus. However, I can not manage to do this:

The calculus is

sum(distinct width)
*
sum(large)


and it should multiple line per line having a new column (new field) being the sum of all the lines, should it be with an aggregate, including total in set analysis?


For example, I have the large and width and I want a new column with the sum of each line after doing the calculus width*large


largewidthwidth*largeNew field
85,370,01090,931,56
80,160,00790,631,56



any ideas?


Thanks in advance.

1 Solution

Accepted Solutions
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

that you can do it by AGGR..

sum (Total Aggr(sum(Distinct width) * sum(large),YOUR DIMENSIONS IN CHART))

For example.

sum (Total Aggr(sum(Distinct width) * sum(large),FIELD1,FIELD2))

View solution in original post

2 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

that you can do it by AGGR..

sum (Total Aggr(sum(Distinct width) * sum(large),YOUR DIMENSIONS IN CHART))

For example.

sum (Total Aggr(sum(Distinct width) * sum(large),FIELD1,FIELD2))

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Script:

LOAD

*

INLINE [

large, width

85.37, 0.0109

80.16, 0.0079];

Straight Table:

Dimensions : large, width

Expressions:

width * large : sum(width * large)

New Field : sum(TOTAL width * large)

Hope this helps you.

Regards,

Jagan.