BookmarkSubscribeRSS Feed
cgomez

Community Trekker

Joined:

Sep 25, 2012

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?

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz

Super User

Joined:

Jun 23, 2011

Solution

Re: function for room number by floor

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

floor(num(:room) / 100)

4 REPLIES
reeza

Community Trekker

Joined:

Jun 23, 2011

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);

cgomez

Community Trekker

Joined:

Sep 25, 2012

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

pmroz

Super User

Joined:

Jun 23, 2011

Solution

Re: function for room number by floor

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

floor(num(:room) / 100)

cgomez

Community Trekker

Joined:

Sep 25, 2012

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.