11 Replies Latest reply on Sep 22, 2016 1:33 AM by Gregory Askew

# writing a calculated field for a base 10 to base 36 converter

Hi all,

I'm doing a tableau dashboard and have lots of IDs in base 10 but really would like them in base 36, the formula for doing that is:

where b=36

d=10

does anyone know how to write this as a calculated field in tableau?

Thanks,

Greg

• ###### 1. Re: writing a calculated field for a base 10 to base 36 converter

Tableau Directly allows you to give base . So if you wan to find out log 5 to base 36 , you will need to write LOG(5,36) . Screen shot attached. If this answers your question , please mark it as answer so that the post is not left as answered.

Thanks

• ###### 2. Re: writing a calculated field for a base 10 to base 36 converter

No I know about that function and I think I'll need to use it in my calculated field, but what I'm trying to do is write a calculation that will translate an ID such as: 17275725 (base 10) to AAA19 (base 36).

When I put these into an online converter it does this just fine, but I need a converter in my tableau as I have over 400 IDs and doing them all individually doesn't seem like the best way to do it.

I tried (LOG(10,[Numeric_ID]))/LOG(10,36) but this gives log_36[short_ID] but all I'm looking for is short_ID

Maybe I can wrap the formula in something exponential that will get rid of the log_36?

Thanks

• ###### 3. Re: writing a calculated field for a base 10 to base 36 converter

This formula will give you the number as base 36 string (up to 6 letters):

You can choose your base with the parameter.

1 of 1 people found this helpful
• ###### 4. Re: writing a calculated field for a base 10 to base 36 converter

Shouldn't you be simply doing the below , say i have so many sales value , and i need to find out the log of each of the sales value to the base 36  , i did the below and showing the calculated field as below : , if this is not what you want , please explain what you want in the below example

• ###### 5. Re: writing a calculated field for a base 10 to base 36 converter

Hi Lukasz,

That looks like exactly what I need, but when I put the first line into the calculation I get the errors:

And putting the other lines just gives more errors.

I have noticed I'm on tableau 9.0.4 whereas you're on a more recent version, could this be the problem?

Many thanks

• ###### 6. Re: writing a calculated field for a base 10 to base 36 converter

or have you defined Base10 and base as dimensions previously?

As In my calculated field they're not orange or purple respectively.

Akriti, I'm trying to convert numeric ids which are in base 10 into base 36, which come out as something like AAA45, the reason that the LOG function doesn't work is because it just outputs the log in numbers, not in the correct base 36 form

• ###### 7. Re: writing a calculated field for a base 10 to base 36 converter

I attached a packaged workbook (9.3) so you can open it and check everything. I used a sample of numbers - [base10] field - and the [base] is a parameter.

• ###### 8. Re: writing a calculated field for a base 10 to base 36 converter

replace my fields with yours....

I guess [Bot Id] instead of base10 and 36 for [base] if you do not want a parameter...

is this your first tableau workbook?

• ###### 9. Re: writing a calculated field for a base 10 to base 36 converter

I realised that you cant use char with a live data source only an extract so I did that and it worked perfectly, thanks very much!

Nope not my first workbook but my first one using a calculated field..usually I do all that stuff on bigquery before but this way was easier this time