Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

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.

16 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Could you please send an example?

markgraham123
Specialist
Specialist
Author

Please find the app.

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

Anonymous
Not applicable

use

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

as expression

settu_periasamy
Master III
Master III

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
Specialist
Specialist
Author

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
Specialist
Specialist
Author

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
Partner - Champion III
Partner - Champion III

But why you need to use a Group by?

markgraham123
Specialist
Specialist
Author

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
Specialist
Specialist
Author

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.