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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
draghici1109
Creator
Creator

Splitting a qvd file

Hello,

I want to splitt the file xxx according to the values from this table:

 

MANDT_AGS:
load * inline [
Mandant
000
002
003
090
101
103
108
114
119
133
148
153
160
167
178
197
294
300
301
304
305
308
340
350
351
366
375
515
550
555
585
600
628
644
650
710
800
850
860
866
900
998
999
];
 
For j = 0 to NoOfRows('MANDT_AGS') - 1
set vMandt =;
    let vMandt = text(Peek('Mandant', $(j), 'MANDT_AGS'));
trace vMandt $(vMandt);
[$(vMandt)]:
//wir splitten Daten nach Mandant
NoConcatenate
LOAD *
from [..\DATA\00-HP1-T501T.qvd](qvd)
WHERE text(MANDT) = $(vMandt);
if NoOfRows('[$(vMandt)]') > 0  then
STORE [$(vMandt)] into [..\DATA\SPLITTING\00-HP1-T501T-$(vMandt).qvd](qvd);
drop Tables [$(vMandt)];
ELSE
drop tables [$(vMandt)];
ENDIF;
  NEXT j;
EXIT SCRIPT;
 
 
The file 00-HP1-T501T.qvd is attached bellow. 
I do not understand why the code does not store the files. 
 
Thank you in advance!
Alexandru Draghici
BICC at Komm.ONE
Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

The square-brackets here are wrong:

if NoOfRows('[$(vMandt)]') > 0  then

because all table/field-functions take the reference-parameter already as string and any space or special chars within the name must not be wrapped.

 

View solution in original post

1 Reply
marcus_sommer

The square-brackets here are wrong:

if NoOfRows('[$(vMandt)]') > 0  then

because all table/field-functions take the reference-parameter already as string and any space or special chars within the name must not be wrapped.