How to get numbers between 2 numbers?

To get the all numbers between 2 numbers.

  Discussion posts and replies are publicly visible

Parents
  • If by "between" you mean "including the lower and upper values" then this would work for you:

    if(
      ri!lower > ri!upper,
      fn!tointeger({}),
      fn!enumerate(ri!upper - ri!lower + 1) + ri!lower
    )

    ...where ri!upper and ri!lower are integer values.

    If you want to exclude the lower/upper values then that would be a small tweak to the above code.

Reply
  • If by "between" you mean "including the lower and upper values" then this would work for you:

    if(
      ri!lower > ri!upper,
      fn!tointeger({}),
      fn!enumerate(ri!upper - ri!lower + 1) + ri!lower
    )

    ...where ri!upper and ri!lower are integer values.

    If you want to exclude the lower/upper values then that would be a small tweak to the above code.

Children
No Data