2 Replies Latest reply: May 15, 2014 10:03 AM by joey RSS

    Opposite of TRUNC function

    Marc Osborne

      Hi,

       

      I need to create a calculated field that contains the opposite of the TRUNC function. I want to see only those rows where the value in a certain column has a value other than O. In other words if the value to the right of the decimal point indicates anything other than a whole number I want to see the row. If it's a whole number I don't want to see it. Any help toward that end is appreciated.

       

      Thanks,

       

      Marc

        • Opposite of TRUNC function
          Data Kruncher

          Hi Marc,

           

          You want to create a filter with an expression similar to:

          (MyValue - Int(MyValue))>0[/CODE]

           

          Kruncher

          • Opposite of TRUNC function
            joey

            You could do: X - Trunc_XL(X)

             

            There's plenty of other ways to handle it when you convert it the numer to a string.  You could use the LSplit function to split the string on the decimal point and return the second part.  You could compare the length of the string to where the decimal point appears.  If the decimal point is not present if it is a whole number, you could search for a decimal point in the string.

             

            I'm sure there's at least a dozen other ways, but here's a few.  Pick the one that makes the most sense to you.