Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
sunny_talwar

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;

View solution in original post

5 Replies
sunny_talwar

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
Author

ok i changed some settings and everythings works fine.

Not applicable
Author

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?

sunny_talwar

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

Not applicable
Author

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!