### Title

Can i combine get as number with left?

### Post

Im trying to get this data set (010374 which = $ratebasisnum) as a number, then get the 1st number to its left or the 1

Im using the statement:

If [getasnumber ($ratebasisnum) < 5000]

set Variable [$scaleNumber; value:getasnumber ($ratebasisnum) & left ($ratebasisnum ; 1)

end if

In the data viewer $scalenumber = 10374

I tried taking out the getasnumber and i get 0

Why?

You can nest them:

Left ( getasnumber ($ratebasisnum) ; 1)

Or you can use the let function to break it down into steps:

Let ( n = getasnumber ($ratebasisnum ; left ( n ; 1 ) )

Both of these expressions produce exactly the same results. If I'm just using two functions, I'll probably use the first option and nest one inside the other, but if I need to nest more or other factors add to the complexity of my expression, I use Let.

Note:

Nested functions evaluate from the inside out.

Let functions evaluate from left to right / top to bottom.