5 Replies Latest reply: Oct 19, 2015 3:44 AM by elham kabir

# function in function in set analysis

Hello friends

I want to count rows that avg(A-B)<=0 with set analysis like bellow:

count({<Avg(A-B)={"<=0"}>} Avg(A-B))

Thanks

• ###### Re: function in function in set analysis

Average is an aggregation function, and I am unclear how you want to use this on a record base.

In general, you need a field name, no function allowed, left from the equal sign in a set modifier.

I am still unclear what you are trying to achieve, so please post some sample data records and your expected outcome.

• ###### Re: function in function in set analysis

SO how i can write my instruction

i wanna get average of column and count rows if their average are less than zero

thank you swuehl for help

• ###### Re: function in function in set analysis

=Sum( Aggr( -(Avg(A-B)<0) , Group ) )

Group is the dimension that you want an average for. The comparison Avg(A-B)<0 will return -1 or 0 for true or false and the -1 we can invert the sign so we get a 1 which is easy to do a Sum which is essentially then a count...

• ###### Re: function in function in set analysis

Here is a demo:

• ###### Re: function in function in set analysis

Hi Petter! Thanks for taking time to answer.