7 Replies Latest reply: Jul 19, 2018 12:12 AM by Louis Lam

# Sum Conditional in Set Analysis

HI,

This statement seems to not be working at all

=count({<{\$(=sum(InvoiceFlag))}={'\$(>1)'}>} distinct  CompanyID)

The aim of the expression is to count the CompanyID's where the sum of the invoice flags is greater then 1.

Regards

• ###### Sum Conditional in Set Analysis

Hi,

store sum(invoice fllag) in a seperate variable

Then use syored variable here in the expression

Sivaraj S

• ###### Sum Conditional in Set Analysis

Take sum(Invoiceflag) in a variable say var1

and use this:

=count({<\$(var1)={'>1'}>}distinct  CompanyID)

• ###### Sum Conditional in Set Analysis

=count({<var1'>1'>}distinct CompanyID)

• ###### Sum Conditional in Set Analysis

Hey Acrobat,

Thanks for this input.

This solution doesnt work, I think it is because the sum in the variable is used across all of the companies whilst the actual expression is for one company.

That is why I tried to package this all into one expression with set analysis.

• ###### Re: Sum Conditional in Set Analysis

Hi,

Check with this

=count({<CompanyID={"=sum(InvoiceFlag)>1"}>} distinct  CompanyID)

Celambarasan

• ###### Re: Sum Conditional in Set Analysis

hi Celambarasan,

Is it possible to

=count({<CompanyID={"=sum(InvoiceFlag)>1 & < 5" }>} distinct  CompanyID)

something like that.

Thx.

Best Regards,

Louis

• ###### Re: Sum Conditional in Set Analysis

Hi  hamishimrie,

just use this

=count( {<InvoiceFlag={ '>1'} >}    CompanyId)

it works!!