Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Part of formula does not work

berenyiattila
7 - Meteor

Hello Community,

 

I got stack at this point, the rate check (with red) does not work. Could you please point out where should I start?

 

IF LEFT([Correct VAT code],10)="DEVAT_S_SR"
AND IsEmpty([Comment])
AND (Round([Rate],0.01)!=0.16 OR Round([Rate],0.01)!=0.19)
AND [LINE BASE AMOUNT]<2
AND [LINE BASE AMOUNT]>-2
THEN "small amount rounding"
ELSE [Comment 2]
ENDIF

 

The rate is a calculated field as the following: round([LINE TAX AMOUNT]/[LINE BASE AMOUNT],0.01) in number format (decimal 15.2) so the second rounding is unnecessary but still it does not work as it picks up lines with 0.16 and 0.19.

 

It is not the first time formulas are not working that is why I switched to "LEFT" from "CONTAINS" while the latter just did not find the text. Is there something I haven't taken into consideration? Some kind of limitation on the logical operators (AND/OR/etc?)?

 

 

5 REPLIES 5
binuacs
20 - Arcturus

@berenyiattila Can you provide some sample data and expected output please ?

berenyiattila
7 - Meteor

I would prepare a file (it need some work due to company data) as soon as you say that theoretically the formula above is correct and it has to do something with the source. The output is a column with a string "small amount rounding", so nothing special.

Qiu
20 - Arcturus
20 - Arcturus

@berenyiattila 
By not work, you mean the output is not as you expected? rather it throws an error.

If that is the case, I think we should use "And" rather then"or".
Or does not make any sense here.
The  (Round([Rate],0.01)!=0.16 OR Round([Rate],0.01)!=0.19) will always be true.

 

0317-berenyiattila.PNG

berenyiattila
7 - Meteor

Thank for the solution, it is obvious now. :-)

 

I have learned a lesson "not equal" is a tricky operator that should be handled with extra caution.

 

Qiu
20 - Arcturus
20 - Arcturus

@berenyiattila 
Glad to help and thank you for the accept mark! 😁

Labels