Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

erivera10
Contributor

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?

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

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

Maybe like

hours:

LOAD *, natural-double2 as triple2;

LOAD *, Rangemin(natural,9) as double2;

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

];

5 Replies
MVP
MVP

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

Maybe like

hours:

LOAD *, natural-double2 as triple2;

LOAD *, Rangemin(natural,9) as double2;

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

];

vishsaggi
Esteemed Contributor III

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

hello Erick,

This is duplicate thread. Can you close this marking Stefans response correct/helpful, so that it helps other members save their time.

Thanks
V.

atkinsow
Valued Contributor II

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

erivera10
Contributor

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

It works, but I use this:

LOAD employee,

           natural,

           rangemin(natural,9) as double,

           natural-rangemin(natural,9) as triple,

           rangemin(natural,9)+(natural-rangemin(natural,9)) as result

INLINE [

    employee, natural

    1, 8

    2, 9

    3, 11

    4, 12

    5, 13

    6, 10

    7, 11

    8, 13

    9, 14

    10,15

    11,16

    12,17

    13,18

    14,19

    15,20

    16,21

];

erivera10
Contributor

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

Ok, thank you.