Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

markgraham123
Not applicable

Sum() operation in Scripting

Hi all,

I was working on a requirement where i have to count the Sum(Units Sold) per Name and per Place.

So, i did Sum(Units Sold) group by Name , Place in the script and loaded it as a dimension.

It worked but the problem is ..

Eg:

when the units sold is only one value i.e. 10 for Name A - Its not getting counted,

where as if the units were 10 and 5 its getting counted as 15.

Can anyone help me on this.

Tags (2)
16 Replies
alexandros17
Not applicable

Re: Sum() operation in Scripting

Could you please send an example?

markgraham123
Not applicable

Re: Sum() operation in Scripting

Please find the app.

I was wondering why am i not able to display all values in the chart

hrlinder
Not applicable

Re: Sum() operation in Scripting

use

=sum("Sum([Units Sold])")

as expression

settu_periasamy
Not applicable

Re: Sum() operation in Scripting

for better understanding you can give the alias name in the script like.

Load Name, Place,

Sum([Units Sold]) as [Unit Sold] Group by Name, Place;

then you can use the expression Sum([Unit Sold])

markgraham123
Not applicable

Re: Sum() operation in Scripting

Hi,

Tried that too..

but not working.

The problem is when i'm summing in the script and storing in a dimension...the single values were not getting summed up and so i cannot see the same in the front end.

markgraham123
Not applicable

Re: Sum() operation in Scripting

Hi,

The problem is when i'm summing in the script and storing in a dimension...the single values were not getting summed up and so i cannot see the same in the front end.

alexandros17
Not applicable

Re: Sum() operation in Scripting

But why you need to use a Group by?

markgraham123
Not applicable

Re: Sum() operation in Scripting

because i want to sum the units by Name and Place..

If there is any way without using the group..please let me know

markgraham123
Not applicable

Re: Sum() operation in Scripting

A    B

2    4

3

In my original application, when im using sum() it is counting 5 for A.

But not 4 for B.

It is not summing when there is only one value..

Hope i'm clear.