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: 
varmekontrol
Creator
Creator

Qlikview - Store split files, from distinct 'meter number'

Hi

Can you help me figure out why this script is only generating 1 empty file? 
First of all, the file should contain multiple records, and there are 10 different meter numbers = 'device-identification'

Ladestation_2105:
LOAD 0020036601 as '#serial-number',
mid(@2,15,4) & mid(@2,23,4) as 'device-identification', 
Date(mid(@7,1,10),'YYYY-MM-DD HH:MM:ss') as created

FROM
[\\local\Server\FTP\Data\Data_Ladestation\*.csv]
(txt, codepage is 28591, explicit labels, delimiter is ';', msq, header is 1 lines) where @7>=2018;

//STORE Ladestation_2105 into c:\temp\ladestation_2105.csv (txt, delimiter is ';');


Temp_meterno:
Load Distinct 'device-identification' 
Resident Ladestation_2105;

FOR i=1 to NoOfRows('Temp_meterno')
LET vMeterNO = FieldValue('device-identification',$(i));

NoConcatenate
Temp_Store: 
Load *
Resident Ladestation_2105 Where 'device-identification' = '$(vMeterNO)';



STORE Temp_Store into [c:\temp\$(vMeterNO).csv] (txt, delimiter is ';');

DROP Table Temp_Store;

NEXT;

DROP Table Temp_meterno;

 

2 Solutions

Accepted Solutions
jfkinspari
Partner - Specialist
Partner - Specialist

I would debug the script piece by piece.
E.g. make sure that the table Temp_meterno actually contains the expected 10 rows.

View solution in original post

marcus_malinow
Partner - Specialist III
Partner - Specialist III

ok I have found two issues. Corrections below...

Temp_meterno:
Load Distinct [device-identification]
Resident Ladestation_2105;

FOR i=1 to NoOfRows('Temp_meterno')
LET vMeterNO = FieldValue('device-identification',$(i));

NoConcatenate
Temp_Store:
Load *
Resident Ladestation_2105 Where [device-identification] = '$(vMeterNO)';

View solution in original post

3 Replies
jfkinspari
Partner - Specialist
Partner - Specialist

I would debug the script piece by piece.
E.g. make sure that the table Temp_meterno actually contains the expected 10 rows.
varmekontrol
Creator
Creator
Author

That was a two in one answer 🙂
That helped, and now i know there is a step by step debugger 🙂

Thx.
marcus_malinow
Partner - Specialist III
Partner - Specialist III

ok I have found two issues. Corrections below...

Temp_meterno:
Load Distinct [device-identification]
Resident Ladestation_2105;

FOR i=1 to NoOfRows('Temp_meterno')
LET vMeterNO = FieldValue('device-identification',$(i));

NoConcatenate
Temp_Store:
Load *
Resident Ladestation_2105 Where [device-identification] = '$(vMeterNO)';