Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Formula inside IF Statement

Hi all,

How do I do two different calculations within the same expression depending on the value in a field?

I have tried with the calculation below, but it does not work

If( Source = {'Maintenance'}, Sum([Target], Sum(Aggr(Sum(Target) / Count (distinct SC_ID),YearMonth,[Target Component Group],ID)) )

My True and False statements works fine seperately, but not when I am trying to combine it in an IF Statement.

Best regards,

Thomas

3 Replies
marcus_sommer

There is a missing bracket by the first sum(Target) and if-check has a wrong syntax:

If( Source = 'Maintenance', Sum([Target]), Sum(Aggr(Sum(Target) / Count (distinct SC_ID),YearMonth,[Target Component Group],ID)) )

- Marcus

felipedl
Partner - Specialist III
Partner - Specialist III

Hi Thomas,

Try

If( Source = 'Maintenance', Sum([Target]), Sum(Aggr(Sum(Target) / Count (distinct SC_ID),YearMonth,[Target Component Group],ID)) )



felipedl
Partner - Specialist III
Partner - Specialist III

Beat me to it Marcus