Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

conditional load with filed from other table

hi,
is it possible to use a field from another (allready loaded) table in a load condition of another table ?
its possible in sql, but how could it be done in qlikview script ?

the table "customers" is loaded first.


"customers" (customer_id, customer_area, subarea_code, customer_name)

customer_area= city
subarea_code= district/zipcode

f.e. i want to load purchase histories from one table
"sales" (order_id, order_date, order_amount, item_ID, customer_id)


BUT only for customers who live in a certain area

of course this could be done in the document with listboxes etc. But the huge amount of data from orders should be limited during load.

i could  be usefull for other loads too, especiall with large amounts of data and distributed dependencies.

1 Solution

Accepted Solutions
datanibbler
Esteemed Contributor

Re: conditional load with filed from other table

Hi,

so you load a mastertable > customers < first?

You could do a restricted RESIDENT LOAD of that, restricting to the areas that you want (if you don't want all of them) and then use a WHERE EXISTS clause in the following LOAD of the > sales < table?

HTH

2 Replies
datanibbler
Esteemed Contributor

Re: conditional load with filed from other table

Hi,

so you load a mastertable > customers < first?

You could do a restricted RESIDENT LOAD of that, restricting to the areas that you want (if you don't want all of them) and then use a WHERE EXISTS clause in the following LOAD of the > sales < table?

HTH

Not applicable

Re: conditional load with filed from other table

yes, >customers< is loaded before >sales< . i edited the question to make that more clear.
your proposal worked well, thank you.

the load of the >customers< list will be restricted by area, containing only users that match the area.

other users needed to be loaded later on, f.e. with outer join load.the


i only used where not exists before for incremental loads
where NOT exists (change_date)

WHERE EXISTS (subarea_code) worked fine.

Community Browser