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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mahendragaur
Creator
Creator

Sum columns

Hello,

I have to sum columns based on parameter mentioned in table. Below is input table -

    

NameMerge ColumnColumn1Column2Column3Column4Column5
A112345
B212345
C312345
D212345
E412345

Merge Column is a parameter on which columns should be summed up and result should be shown in columns.

for ex - Name B. 2 is mentioned in merge column then column1+column2 is added and result should be shown in column1 (same for column 3 and 4). If merge column=1 then leave it as it is.

For merge column=3. 3 consecutive column should be added and sum should be shown in 1st column.

Expected output-


    

NameMerge ColumnColumn1Column2Column3Column4Column5
A112345
B2375
C369
D2375
E4105
2 Replies
asgardd2
Creator III
Creator III

Hello!

I don't understand, how did you calculate values to Column 2 and Column 3.

For ex. Name = 'B' (Column2 = 7,Column3=5) and Name = 'C'(Column2 = 9, Value from Column3 is empty) 

mahendragaur
Creator
Creator
Author

Hi Anton,

for Name = 'B' (Column1 = Column1+Column2,

                         Column2 = Column3+Column4,

                         Column3=Column5+Column6)


because Merge column =2.

Since Column6 is not available that's why column3=column5


for Name = 'C' (Column1 = Column1+Column2+Column3,

                         Column2 = Column4+Column5+Column6)


because Merge column =3.

Since Column6 is not available that's why column2=Column4+Column5


You can create different table for Output.