Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
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)';
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)';