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?)?
Solved! Go to Solution.
@berenyiattila Can you provide some sample data and expected output please ?
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.
@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.
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.
@berenyiattila
Glad to help and thank you for the accept mark! 😁