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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

Loop

Hi Community,

I copied a script called inc qvd-qvd loop.qvf

but it doesn't work.

My path is: C:\QLIK SENSE SAMPLE DATA\data sources\qvd\

variable d = users

what am I missing?

I expect Immagine.png

3 Replies
fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi Community,

I stepped forward . Now , I need to understand why the value of d is users but the result is a created file named $(d).qvd

Immagine.png

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

This is just a hunch, but it looks like the $-sign that appears after a back-slash '\' is treated literally as a string $ and not as a $-sign expansion. Questions to consider:

1. Do you need 2 forward-slash characters? I think you should be fine with this:

$(vDataDir)$(d) , considering that the variable vDataDir is ending with a forward slash.

2. Perhaps you could build the whole path and file name as a single variable before the load and therefore eliminate any possibility of a confusion.

cheers,

Oleg Troyansky

Check out my new book QlikView Your Business: An expert guide to Business Discovery with QlikView an...

Ask me about Qlik Sense Expert Class!
fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi,

it seems correct debugging it but fhe files created are uncorrect.

Why the extension is .qvf.

and

Why the name is $(d).

 I do not understand. The folder contains files users.qvf and $(d) .qvd .

Immagine.png

//STORE TABLES AS QVD

SET vDataDir = 'lib://qvd data/';

for i=0 to NoOfTables()-1

  LET d= TableName(i);

  STORE $(d) into $(vDataDir)$(d).qvd;

NEXT

LET j = NoOfTables();

do while j > 0

  let d = TableName(0);

  drop table $(d);

  let j = NoOfTables();

loop