Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

simple if in data editor

hi com,

i have this section in my editor:

-------------------------------------------------------------------

temp:

NOCONCATENATE

load articlenumber,amount,date as in_date

Resident time_TAB

where "in/out" ='in';

left join

load articlenumber,date as out_date

Resident time_TAB

where "in/out" ='out';

time_in_company:

Load articlenumber,in_date,out_date,

out_date-in_date as diffdate resident temp;

-------------------------------------------------------------------

now i want the diffdate to be 0 when its drops below 0, cause a product cant be for -5 days in the company.

i tried some if constelations but i didn't work!

Help pls, thanks in advance!

Eric

Tags (4)
1 Solution

Accepted Solutions

Re: simple if in data editor

May be this:

temp:

NOCONCATENATE

LOAD articlenumber,

          amount,

          date as in_date

Resident time_TAB

where "in/out" ='in';

left join (temp)

LOAD articlenumber,

          date as out_date

Resident time_TAB

where "in/out" ='out';

time_in_company:

LOAD articlenumber,

          in_date,

          out_date,

          out_date-in_date as diffdate

Resident temp

Where out_date-in_date >= 0;

5 Replies

Re: simple if in data editor

May be this:

temp:

NOCONCATENATE

LOAD articlenumber,

          amount,

          date as in_date

Resident time_TAB

where "in/out" ='in';

left join (temp)

LOAD articlenumber,

          date as out_date

Resident time_TAB

where "in/out" ='out';

time_in_company:

LOAD articlenumber,

          in_date,

          out_date,

          out_date-in_date as diffdate

Resident temp

Where out_date-in_date >= 0;

Not applicable

Re: simple if in data editor

ok i changed some settings and everythings works fine.

Not applicable

Re: simple if in data editor

now i try to do the same with a counter for the amount of unit in and out so i have a more realistic number.

So i count down the first date till every unit is out and then take the next in-date!

Do u have some advice for me or tips?

Re: simple if in data editor

Not sure I understand what the issue now is? Can you elaborate?

Not applicable

Re: simple if in data editor

so for example u have this story:

article     amount       in/out        date

1              20               in          2/4/2016

1              2                 in          4/6/2016

1              5                 out        10/6

1              17               out        12/6

so the first one would be 5 out from 2/4 - 10/6 in store

and the other one would be 17

                                        15 from 2/4 to 12/6

                              and      2 drom 4/6 to 12/6

so First in First out but with a count down of the amount so the numbers are korrekt!

Thx for ur help in advance!