Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

IF THEN Statement

tzmarzly
5 - Atom

IF [Dr/Cr Difference]>0.0001 or [Dr/Cr Difference]<-0.0001 THEN "JE_ID"+[JE_ID]+ "reports"+ "total" + "debits" + "of" + [Sum_Debit] + "and" + "total" + "credits" + "of"+[Sum_Credit]+"." ELSE "" ENDIF

 

I cannot get this formula to work. Any Ideas?

8 REPLIES 8
Emil_Kos
17 - Castor
17 - Castor

Hi @tzmarzly,

 

What kind of error do you get?

 

tzmarzly
5 - Atom

Whenever I place the endif in the formula, it no longer recognizes half of the formula anymore.

tzmarzly
5 - Atom

It says malinformed statement before I place the endif and when input the endif half of the formula is no longer referenced.

atcodedog05
22 - Nova
22 - Nova

Hi @tzmarzly ,

 

I think i have a clue where you might be failing.

 

You need to use ToString() function (for converting numbers to string) if you want to do append with string.

 

Guessing your [Sum_Debit] and [Sum_Credit] is a number

atcodedog05
22 - Nova
22 - Nova

Hi @tzmarzly ,

 

Share about few rows of data as sample we can crack it for you.

atcodedog05
22 - Nova
22 - Nova

Hi @tzmarzly ,

 

Try this

 

IF ([Dr/Cr Difference]>0.0001 or [Dr/Cr Difference]<-0.0001) THEN "JE_ID"+ToString([JE_ID])+ "reports total debits of"+ ToString([Sum_Debit]) + "and total credits of"+ToString([Sum_Credit])+"." ELSE "" ENDIF

 

Or else tell us the datatypes of these column. We can help you out.

 

[Dr/Cr Difference],[JE_ID],[Sum_Debit],[Sum_Credit]

tzmarzly
5 - Atom

tzmarzly_1-1600972577033.png

 

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : )

Labels