Alteryx Designer Desktop Discussions

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

Reverse a Number in each row

berty
8 - Asteroid

Hi all, 

 

I'm fairly new to Alteryx and i'm having an issue with a number - i need to reverse numbers in a column using Alteryx but cannot seem to figure out how to do this.

 

I have a set of numbers in each row -

Example

Number           Expected Reverse Result

123456             654321

789456             654987

741852             258147

5 REPLIES 5
LordNeilLord
15 - Aurora

Hey @berty 

 

You could try:

 

ToNumber(ReverseString(tostring([Number])))

 

 

ChrisTX
15 - Aurora

This might help in the future, to identify a Function for a specific purpose.

 

This page lists all Functions:

https://help.alteryx.com/current/Reference/Functions.htm

 

Under the Search box, if you click the 3rd icon for Expand All, you can then search for "reverse" to find information on the ReverseString function.

 

 

berty
8 - Asteroid

Just a quick question, I noticed on some of my values it didn't carry through correctly for example serial code 00000879 translated as 978 but in reality it should be a min of 4 - therefore should show 9870 - (note the other serials could be 5 or 6 character long but where a 0 is on the 4th character it drops. is there a way around this?

berty
8 - Asteroid

Actually i could add a formula in to check character length?

 

If length ([field 1] <4 the add?  - but not sure how to finsh this off?

Thableaus
17 - Castor
17 - Castor

Hi @berty 

 

In that case just use ReverseString([Field])

 

If you have a Serial Code like "00000879" this is already considered a String, not a number. Number types don't allow "0"s in front. Then you don't need to use conversions like ToString, or ToNumber.

 

Cheers,

 

 

Labels