Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional LOAD

Hi. I have 2 types of exel files. One type contents direct tables,  another type contents transposed tables.

I can open each one in macro by excel API to check is table direct or transope, then  make script by macro and after it load.

But it seems to me this is too difficult for such a simple problem

Is there another solution?

Maybe something like

Load * from [2.xlsx](ooxml, embedded labels, table is Лист1, if( value = 1,  filters(Transpose())); ?

1 Solution

Accepted Solutions
marcus_sommer

You could check a fieldname/fieldvalue before you load the data completely. You need only a unique field.

Check:

Load @1 as Check From .... where rowno() = 1;

let vCheckLoad = if(peek('Check', 0, 'Check') = 'ANY', 'direct', 'transposed');

if '$(vCheckLoad)' = 'direct' then

     Load .... first

else

     Load .... second

end if

- Marcus

View solution in original post

2 Replies
marcus_sommer

You could check a fieldname/fieldvalue before you load the data completely. You need only a unique field.

Check:

Load @1 as Check From .... where rowno() = 1;

let vCheckLoad = if(peek('Check', 0, 'Check') = 'ANY', 'direct', 'transposed');

if '$(vCheckLoad)' = 'direct' then

     Load .... first

else

     Load .... second

end if

- Marcus

Not applicable
Author

Thank you!