Forum Discussion

Pan_Forex's avatar
Pan_Forex
Helper III
3 years ago
Solved

linear progression

Hello guys, do you have any idea how to easily add a fixed increment? The only thing I can think of is the if function, but I have several thousand rows and would prefer to streamline it 🙂 Simple data:

xy
12551
25450,99
35550,98
47870,97
62220,95
65650,95
88550,93
90010,91
96550,91

I would like the function, after x increases by 1000, to subtract 0.01 from y. This can be as a new column or function, of your choice.

 

  • FreemanZ's avatar
    FreemanZ
    3 years ago

    hi Pan_Forex 

    then try this:

    y = 1- TRUNC( [x]/1000)*0.01

     

    please consider @ someone, if you seek further suggestions.

3 Replies

    • Pan_Forex's avatar
      Pan_Forex
      Helper III

      Because the range is between 0-1000, 1001-2000, in the second example there is an error. let's make it simple. For numbers < 1000-1, between 1001-2000=0,99, between 2001-3000=0,98 and so on

      • FreemanZ's avatar
        FreemanZ
        Super User

        hi Pan_Forex 

        then try this:

        y = 1- TRUNC( [x]/1000)*0.01

         

        please consider @ someone, if you seek further suggestions.