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

To sum in script

I have 3 columns like basicpay, hra, Variable pay I have to add these 3 columns .But while using sum function it accepts only 1 parameter.Please help  me find out the code  which I want  to be done in  script and to display the values in the dashboard...

   

BasicHRAVariable payTotal
4000300015008500
19 Replies
saniyask
Creator
Creator

Hi,

You can do this in the Dashboard or frontend.

Try sum(Basic) + Sum(HRA) + Sum(Variable Pay)

regards,

Saniya.

surendraj
Specialist
Specialist

try with rangesum

rangesum(Basic,HRA,Variable pay)

Not applicable
Author

I want to calculate individual sum for each employees.

   

BasicHRAVariable payTotal
4000300015008500
5000250015009000
70004000250013500
120005500100018500
Anonymous
Not applicable
Author

Why  not use sum(Basic) + Sum(HRA) + Sum(Variable Pay) group by employee??

yoganantha321
Creator II
Creator II

Priya,

Simply try with the following expression

Aggr(Sum(Basic+HRA+[Variable Pay]),EmpID)


I got the output as below

Screenshot_40.png

as you needed.........

I think it is useful

Not applicable
Author

I want to implement this in script backend..how?

Anonymous
Not applicable
Author

You can use either of group by or rangesum

Anonymous
Not applicable
Author

Hi ,

Direcly use this fields and create new field like-

Basic + HRA+ Variable Pay as Total


If you need do group by,You will get expected result.


Thanks

Paridhi


yoganantha321
Creator II
Creator II

priya,

Just do like this

LOAD EmpID,

     Basic,

     HRA,

     [Variable Pay],

     Basic+HRA+[Variable Pay] as Total

FROM

(ooxml, embedded labels, table is Sheet1);

Note: if you have many values for single employee just use group by employee id

Screenshot_41.png