Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for
Did you mean:
Contributor II

## Filtering records in a Straight Table and recalculating measures

I´m trying to filter some records in a straight table (based on an input variable), and then recalculate some measures. As you  can see below, in the last expression I would like to make a second agregation based on the results of column(2). In this example, the correct result for the last expression should be 23. It shows 0.  Is it possible to do a second aggr()? Expressions are evaluated from left to right?

1 Solution

Accepted Solutions
Master II

I guess its not possible because column(n) function and references to the expression name operate on a strictly row by row basis. It is not possible to use multirow aggregations. So i think you will have to use the original formula in order to achieve your desired output:

```max(total aggr(if(Sum (val)<\$(vFiltra),Sum (val),null()),id))
```

hope this helps

4 Replies
Champion III

Is your col2 is a field name from your table or an expressions? If it is an expression just use like

= Max(TOTAL <ID> col2Expr)

Contributor II
Author

Col2's expresion:  Column(2)

Master II

I guess its not possible because column(n) function and references to the expression name operate on a strictly row by row basis. It is not possible to use multirow aggregations. So i think you will have to use the original formula in order to achieve your desired output:

```max(total aggr(if(Sum (val)<\$(vFiltra),Sum (val),null()),id))
```

hope this helps

Contributor II
Author

Thanks, Frank.

Everything fine now.

Regards

Community Browser