Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
paulo_costa_ifp
Contributor II
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?

Capturar.JPG

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
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

View solution in original post

4 Replies
vishsaggi
Champion III
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)

paulo_costa_ifp
Contributor II
Contributor II
Author

Capturar1.JPG

Col2's expresion:  Column(2)

No results, up till now.

Frank_Hartmann
Master II
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

paulo_costa_ifp
Contributor II
Contributor II
Author

Thanks, Frank.

Everything fine now.

CapturarResolvido.JPG

Regards