Announcements
Hi,
Im trying to create an If Statement so that if the choice field is a Sell, I Sum the amount and if its a Buy I add Subtract the amount by multiplying it by -1.
My error is saying incompatible types for comparison. But it will not work if I set it to .Value either posted below
'Transaction Type'.Value = "Sell"
Try that
If you need additional help please tag me in your reply and please like my reply.If my reply provided you with a solution, pleased mark it as a solution ✔️!Best regards,Gonçalo NogueiraCheck my LinkedIn!Check my User Group (pt-PT)!
Hi @Nogueira1306
Thanks for responding, I tried that along with the below but neither work.
I get the following errors:
Unfortunately that doesnt work
In the last one I am sure it should be only "Sell"
Do you have that on a gallery or soemthing?Try:
ThisItem.'Transaction Type'. Value = "Sell"
We just need to identify which item we want to compare.
If you need to comapre all, use a ForAll()
Hi @cnr
This is most likely a disambiguation issue that relates to referencing 'Transaction Type' inside a call a call to AddColumns,
I'd try the following syntax to see if that works...
If( 'Transaction Type' = [@'Transaction Type'].Sell
Hi @timl
Thanks for the response,
I'm very confused by this because I used a similar method on a different screen shown here which did work:
I tried that but didnt work, what do you mean by a call a call to AddColumns?
@Hi @Nogueira1306 ,
Yeah I tried that - Says it cannot compare a table and text
I dont understand because I created a similar if statement with the same kind of logic on a choice field and it did work:
I created a Clearcollect in a button where I sum up all my values and then ThisItem.NetAmount.
But I need the Amounts to Sum positively if its a Sell and negatively if its a Buy
Can you confirm that 'Transaction Type' is a single select 'Choice' column, rather than a multi select 'Choices' column, as this could account for the incompatible type error?
Yes its a single select 'Choice' column
Thanks
Conor
@cnr
To diagnose this further, I would try renaming the Transaction Type field to something like TransType, to remove any ambiguity in naming. If you try the formula below, does that result in the same error?
AddColumns( RenameColumns(UpcomingSettlementFundsGroupingFunds, "Transaction Type", "TransType"), "Netting TPlusOne", If( TransType = [@'Transaction Type'].Sell
Hello,
I imagine that "UpcomingSettlementsFundsGroupingFunds" is a colletion (or SP list or whatever)?
if so, you have to browse the source in a loop before doing your condition.
ForAll( UpcomingSettlementsFundsGroupingFunds; If( Choices(ThisRecord.'Transaction Type').value = "sell" .....
Edit: Replace the ";" by ","
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 541
WarrenBelz 434 Most Valuable Professional
Valantis 289