
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Problem with Sum(if())
Hey,
I have a problem with a formula: I want to calculate the sum of a field's values only if another field is greater than 1 (or 2, 3...).
I want to calculate the sum of my "available stock" column, for each product hierarchy group (I have a "group level" column which takes the value 1, 2, 3, 4, 5)
I've tried this formula :
Sum(if(group_level>=1, available stock))
but it returns 0
The column "group level" is not in the same table than available stock but both tables are linked
What is the problem ?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Something like
SUM(<group-level={">1"}>)[available stock])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it doesnt work ...
I tried this : SUM({<group-level={">1"}>}available stock) it returns 0 too

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
up

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Guilgo ,
Try this out-
if( group_level >=1 , Sum( [available stock] ) )
Your field is having space you should keep that in square brackets.
Hope this will help...........
Thanks,
Tanish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it doesnt work
it doesn't return anything, maybe because group_level is field and I can't compare it to any value

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SUM({<group-level={"=1"}>}available stock) returns a value but the same as SUM({<group-level={"=2"}>}available stock etc...) (and the same as SUM({<group-level={"=8"}>}available stock) while the maximum value for group_level is 5...)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count({<group-level={"=3"}>}group-level) returns the total of number of rows .... filter doesnt work

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please check from data model viewer if your group-level field datatype is numerical integer or text.
