Choose Language Hide Translation Bar
Highlighted
cgomez
Level I

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

View solution in original post

4 REPLIES 4
Highlighted
reeza
Level III

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

Highlighted
cgomez
Level I

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

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

View solution in original post

Highlighted
cgomez
Level I

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. 

Article Labels

    There are no labels assigned to this post.