Qlik Community

Qlik GeoAnalytics Discussions

Discussion Board for collaboration regarding Qlik GeoAnalytics.

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
Contributor

Re: To sum in script

Hi,

You can do this in the Dashboard or frontend.

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

regards,

Saniya.

surendraj
Valued Contributor

Re: To sum in script

try with rangesum

rangesum(Basic,HRA,Variable pay)

Not applicable

Re: To sum in script

I want to calculate individual sum for each employees.

   

BasicHRAVariable payTotal
4000300015008500
5000250015009000
70004000250013500
120005500100018500
laddu_927
Valued Contributor

Re: To sum in script

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

yoganantha321
Contributor II

Re: To sum in script

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

Re: To sum in script

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

laddu_927
Valued Contributor

Re: To sum in script

You can use either of group by or rangesum

paridhimantri
Contributor

Re: To sum in script

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
Contributor II

Re: To sum in script

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

Community Browser