6 Replies Latest reply on Dec 6, 2018 1:48 PM by Don Wise

# How to Convert Roman Number to Integer

Hi All,

i am working on task where i do need to convert roman numbers to integer.

Lets say:

I have below

numbers

Roman                                             Need them as

I                                                                 1

II                                                                2

III                                                               3

IX                                                               9

LXIX                                                           69

I have create calculated field for each character of Roman number and then summed up them to get final integer.

DO we have any easiest way to do that.

Please let me know if you have example.

Thank you

• ###### 1. Re: How to Convert Roman Number to Integer

Hello Rajesh,

You can follow with what's been done in the attached 2018.3 workbook (screenshot below) of a CASE statement that is using Roman Numeral 1 - 1000.  More than 1000 you'll need to do yourself .  Hope it helps. If it does, please mark this response as correct,  Thx, Don

1 of 1 people found this helpful
• ###### 2. Re: How to Convert Roman Number to Integer

OK, now I'm fascinated to know what project compelled you to do a Roman Numeral conversion template...

• ###### 3. Re: How to Convert Roman Number to Integer

Hey Michael,

No real project need, this was just an easy one for me to do as I'd had this old table of pre-existing roman numeral data to use from way back when I was probably doing some research project in my 30's.

I used Custom Numbering in Excel to format/wrap 'quotes' for the WHEN part using \'@\' then just copied WHEN and THEN on separate columns down their respective columns and then copied/pasted the whole thing into a calc.  Added in the CASE piece before and added an END.  Took all of 5 minutes .

But, now if someone does have a use case scenario...like Rajesh...well, let's see how it ends up being applied.  Great question tho'!  I often wonder how some of my 'helpfulness' and of course yours and everyone else's gets applied to real-world use cases...

• ###### 4. Re: How to Convert Roman Number to Integer

Hello Don,

Thank you for your input. Yes, this is indeed right way.

This was one way I already thought about. but end limit of roman numeral may be not limited (I wanted it to be dynamic).

So I have created calculated field  to convert roman numeral to integer if it is less than or equal to 7000.

but i think that is lengthy process.

Please let me know if I am missing some tableau function or rule which can easily help me with out creating calculated field.

Thank you,

Rajesh Ashok Jaiswal

• ###### 5. Re: How to Convert Roman Number to Integer

Very cool.  I love solutions like this - and you're right, they take on a life of their own.

Nice work!

• ###### 6. Re: How to Convert Roman Number to Integer

Great, glad to have helped. If you would, please mark as correct to close thread so others may find it useful in the future.  Thx! Don