Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Simple Subtraction

mattcoleman
8 - Asteroid

I'm just trying to subtract one column from another in formula (these are small integers). If I use the following, I get "Formula: Invalid type in subtraction operator". I'm setting the new column Data Type to "Int32".

 

[Openings] - [Openings Filled] and my new column name is "# Openings Remaining".

7 REPLIES 7
MarqueeCrew
20 - Arcturus
20 - Arcturus

if you put a select in front of your formula tool, are these two fields truly NUMERIC?

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
mattcoleman
8 - Asteroid

That was the issue, they were coming in as V_WString. When I used SELECT to change them to Int32, the subtraction worked. Thanks!

Kim2
7 - Meteor
Hi, I am having a similar issue, however I changed everything to Int32 and am still not getting the right subtraction. Its messing up where I have a 0-35 so I would want my variance column to be -35 but it is coming back as 0. Do you know why that may be?
CampbellRG
7 - Meteor

 

 

 

cpinhei7
6 - Meteoroid

Guys, i'm with a similar issue.

Is it possible to subtract two different columns containing dates? 

The formula that I included to appear in a new columns was:

[RepairVisitDate]-[Terminated Date]

 

Does the expression look ok to you?

Thanks

Celso

CampbellRG
7 - Meteor

Try DateTimeDiff([RepairVisitDate],[Terminated Date],'days')

cpinhei7
6 - Meteoroid

It worked. Thank you!

Celso

Labels