10 Replies Latest reply on Nov 18, 2018 10:26 PM by ShivaRam Chennapragada

# Help with calculation

I'm having trouble with the syntax for a calculated field...I have a table with Amount and a boolean field called Is Current.  I want to create a calculated field for the current amount, something like if Is Current = 1 then Amount End AS Current_Amount.  I'm having trouble with the syntax for a CASE or IF and can't get anything to work...

THanks!

• ###### 1. Re: Help with calculation

Try this,

SUM(IF isCurrent = 1 THEN Amount END)

• ###### 2. Re: Help with calculation

Step 1

Creating a boolean calc

Step 2

Query to get the true --->Sum(Profit)

Thanks,

Ritesh

• ###### 3. Re: Help with calculation

TRied:  SUM(IF [Is Current File] = TRUE THEN [RVU_Amount] END)

ANd getting the error message, cannot mix aggregate and non-aggregate comparisons or results in IF statements.

• ###### 4. Re: Help with calculation

This?

IF [Is Current File] = TRUE THEN SUM([RVU_Amount]) END

• ###### 5. Re: Help with calculation

Hi, Alyssa

Try this

Avg(IF [Is Current File] = TRUE then {fixed [Is Current File]: [RVU_Amount]} end )

Hope this helps

ZZ

• ###### 6. Re: Help with calculation

IF attr([Is Current File]) = 'TRUE' THEN SUM([RVU_Amount]) END

• ###### 7. Re: Help with calculation

True not enclosed within coma in your calculation

• ###### 8. Re: Help with calculation

My understanding is that isCurrent is a boolean field and not a string field so I guess inverted commas are unnecessary.