ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
GELÖST

Mathematical( division and multiplication) function with in IF statement

draghava
Meteor

I want to create the new column  based on two columns for example , I have column called code "6002" which needs to divide the " Amount column " to split 50/50 else it should repeat the same amount from " Amount column" . please help. 

8 ANTWORTEN 8
draghava
Meteor

BELOW IS THE EXCEL FUNCTION TRYING TO DO IN ALTERYX

 

=IF(F8=6001,H8/2,IF(F8=6009,H8/2,IF(F8=6010,H8/2,IF(F8=6022,H8/2,H8))))

Ladarthure
14 - Magnetar
14 - Magnetar

Hi, could you please post some sample data, if it's in line 8 of your excel file, I would do an alteryx formula like this one:

 

if [Code] = 6001 then then [Amount]/2

elseif [Code] = 6009 then then [Amount]/2

...

else [Amount] endif

 

or a formula like this one

if [Code] in ('6001', '6009'...) then [Amount]/2

else [Amount] endif

draghava
Meteor

I TRIED with below function, 

 

IF [TAX CODE] in (6001, 6009,6010,6022) then [Final Amount ]/2

else [Final Amount ] endif 

 

but its shows  error "tried to apply numeric operator to string value" 

Ladarthure
14 - Magnetar
14 - Magnetar

To use in I think you have to use " or ' and the tax code must be in a string format (use a select tool before your formula to do so).

draghava
Meteor

Untitled picture.png

draghava
Meteor

I CHANGED TO DOUBLE STILL GETTING AN ERROR

Ladarthure
14 - Magnetar
14 - Magnetar

Could you send some sample data?

draghava
Meteor

Thanks I have corrected . The error I done the " Final amount "column was in string I change to " double " and then it works out .

Beschriftungen
Top-Lösungs-Autoren