Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
erivera10
Creator
Creator

I need your help with a formula to put a limit in a field

For example, if I have a field "natural" with value 12, the limit is 9, so in double filed  write 9, and the rest write in another field triple, with value 3.

hours:

LOAD * INLINE [

    employee, natural, double, triple

    1, 8, 8, 0

    2, 9, 9, 0

    3, 11, 9, 2

    4, 12, 9, 3

    5, 13, 9, 4

    6, 10, 9, 1

    7, 11, 9, 2

    8, 15, 9, 6

    9, 11, 9, 2

];

how can I do something like this example, since I only have the natural field?

1 Reply
Anonymous
Not applicable

Hi Erick,

Try with the next script you will get the same result

Regards.

hours:

LOAD

*,

If (natural>9,9,natural) as double,

If (natural>9,natural-9,0) as triple;

LOAD * INLINE [

    employee, natural

    1, 8

    2, 9

    3, 11

    4, 12

    5, 13

    6, 10

    7, 11

    8, 15

    9, 11

];