We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

I got Dups....

hi2019
8 - Asteroid

Hi,

 

I am trying to only show the roman numeral only but now its showing both 4 IV at the end of Pay Name- I think I have to correct this formula or add another formula to remove this -please help

 

elseif Contains([Pay name], " 2" ) THEN [Pay name]
+ 'II'

elseif Contains([Pay name], " 3" ) THEN [Pay name]
+ 'III'
elseif Contains([Pay name], " 4" ) THEN[Pay name] + 'IV' ELSE [Pay name]

 

 

is this part of a larger formula -  am sure it is from this part though

 

thanks!!!!!

14 REPLIES 14
Qiu
21 - Polaris
21 - Polaris

@hi2019 
Can you give some input and desired output?
I can not quite get your question, sorry.

flying008
15 - Aurora

Hi, @hi2019 

 

Try this formula:

 

Left([Pay Name], Length([Pay Name]) -1) + Switch(Right([Pay Name], 1), Right([Pay Name], 1), '1', 'I' , '2', 'II', '3', 'II', '3', 'III', '4', 'IV', '5', 'V', '6', 'VI', '7', 'VII', '8', 'VIII', '9', 'IX')
hi2019
8 - Asteroid

It didnt work but it could be because of how I explained 

 

 

how can I trim it only for those roman numerals to show only 

Deano478
12 - Quasar

@hi2019 What does the data look like we cant just be guessing?

Carlithian
11 - Bolide
11 - Bolide

It sounds like you are wanting to swap the arabic number with the roman numeral

E.g 

Litten 4 would become Litten IV

I would recommend using a find replace and a text input

Numeral Repacement.png


Happy Alteryxing
hi2019
8 - Asteroid

I am not too famaliar with this tool

apathetichell
20 - Arcturus

There is a weekly challenge on this. Look at the solutions for the weekly challenge. https://community.alteryx.com/t5/Weekly-Challenges/Challenge-183-Roman-Numeral-Math/td-p/470370

hi2019
8 - Asteroid

whoa - I think I am more confused lol

 

I just thought I could do a formula or replace?

apathetichell
20 - Arcturus

oh! My bad - I thought they were more complicated. Your problem with your original is that you have the if statement to add the simple numeral. - but you never replace the original number. so intead of:

elseif Contains([Pay name], " 2" ) THEN [Pay name]
+ 'II'

elseif Contains([Pay name], " 3" ) THEN [Pay name]
+ 'III'
elseif Contains([Pay name], " 4" ) THEN[Pay name] + 'IV' ELSE [Pay name]

 

try 

elseif Contains([Pay name], " 2" ) THEN replace([Pay name],'2','II')

elseif Contains([Pay name], " 3" ) THEN replace([Pay name],'3','III')
elseif Contains([Pay name], " 4" ) THEN replace([Pay name],'4', 'IV') ELSE [Pay name]

 

BUT if you start getting into complicated roman numerals - go into the weekly challenge for a solution.

Labels
Top Solution Authors