Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple Loading Scripts?

Hi,

I have 2 sheets and each sheet requires a different data load script.

So how can I have multiple load scripts..... without reloading every sheets data?  In other words - if I'm in sheet1 & I want to reload the data related to sheet1 (& not do a reload for sheet2)?

For example:

(sheet1):

LOAD [@1:n] as 'Text'
FROM

C:\Users\my_docs\folder1\data1

(fix, utf8, no labels);


(sheet2):

LOAD [@1:n] as 'Text'
FROM

C:\Users\my_docs\folder1\data2

(fix, utf8, no labels);

So with this basic example, if I did a reload..... it's reload both?

5 Replies
swuehl
MVP
MVP

Maybe use a trigger on activation of your sheets and set a variable.

Then use this variable when reloading to switch to your correct LOAD statement.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Won't the tables that you don't load be dropped from the data model? IMHO this is not too simple...

swuehl
MVP
MVP

Yes, it would, unless you are using partial reload.

I haven't read the OP's request as to keep all the data in the other sheet, though.

Well, basically I don't really know what exactely the OP wants to do.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You typically will load all data every time. And then limit the data shown on each sheet by using user selections or Set Analysis.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable
Author

Hi,

you can adapt this script.

Using variable you can make conditional soime part of the script

 

// Start loading script data that needs to be load always

     // replace with first load statements

 

// check to identify if full reload is needed

// a full reload is needed 1 time a day

if today() > date(ReloadLastFull) or ReloadFullForce='Yes' then

        set ReloadType='Full';

ELSE   

    set ReloadType='Partial';

    set ReloadLast='Partial';   

    // set the last partial reload

    let ReloadLastPartial = LocalTime();

    // exit point in case full reload is not neeeded

    exit script when ReloadType='Partial'

endif

// data that should be load only 1 time a day

// replace with second load statements

// set the variable to show how was the last reload

set ReloadLast='Full';

set ReloadFullForce='No';

// set the variable to show when was the last full load

let ReloadLastFull = Localtime();