BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
cgomez
Community Trekker

function for room number by floor

In a data table, I have a  column of room numbers, such as 103, 104, 208, 307, 409, 502, 604, 608.  I would like to create a new column of floor for each value such as 1, 2, 2, 4, 5, 6, 6.  I am not sure how to use the function option for this task. Can someone help with this?

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: function for room number by floor

Looks like your column is a character, so change the formula to:

floor(num(:room) / 100)

0 Kudos
4 REPLIES 4
reeza
Community Trekker

Re: function for room number by floor

Is the first digit the floor, this will work for rooms such as 1202 as well that are on the 12th floor.

you can do the following

floor(room/100);

0 Kudos
cgomez
Community Trekker

Re: function for room number by floor

Thank you.   get the following result.  Can you tell me if you have seen this and what it may mean?

2568_pastedImage_1.png

0 Kudos
pmroz
Super User

Re: function for room number by floor

Looks like your column is a character, so change the formula to:

floor(num(:room) / 100)

0 Kudos
cgomez
Community Trekker

Re: function for room number by floor

Sorry I meant that the result would be 1, 1, 2, 3, 4, 5, 6, 6.  Essentially the 1st digits. 

0 Kudos