

Contributor II
2018-11-24
05:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sum total absolute value
Hi everyone,
I have a problem when I calculate sum total of my data. I want to take fabs for each row before sum total
Like my example: x=-1,2,-3,4,-5 (each element is value of each day )
I want sum total= fabs(-1)+fabs(2) + ...+ fabs(-5)
My expectation = 15
Thanks for your help
I have a problem when I calculate sum total of my data. I want to take fabs for each row before sum total
Like my example: x=-1,2,-3,4,-5 (each element is value of each day )
I want sum total= fabs(-1)+fabs(2) + ...+ fabs(-5)
My expectation = 15
Thanks for your help
3,072 Views
4 Replies

Master II
2018-11-24
05:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where do you want to show this value? In a textbox?
Load *, Fabs(X) as Fabs; Load * inline [ Date, X 01/01/2018, -1 02/01/2018, 2 03/01/2018, -3 04/01/2018, 4 05/01/2018, -5 ];
And in Textobject use this to get TOTAL of 15:
sum(TOTAL Fabs)
or
sum(TOTAL Fabs(X))
3,070 Views


Contributor II
2018-11-24
05:33 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help, actually i use it for textbox. But do you have other way to solve by expression , not using load data ?
3,064 Views


Contributor II
2018-11-24
05:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can you use the following expression:
=SUM(FABS(x))
Hope this help you.
=SUM(FABS(x))
Hope this help you.
3,062 Views

Master II
2018-11-24
07:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sum(TOTAL Fabs(X))
or
sum(Fabs(X))
or
sum(Fabs(X))
3,052 Views
