Hello,
Currently, I have the table stored in the QVD and the table contains the column name as Extraction_Date, Before I store the new data to this QVD, I wanted to remove all the rows having the Extraction_Date as Today() ,So even if the script runs multiple times in same day always it removes existing rows and adds the new rows
I have tried as below
After doing this and when I run the scripts multiple times in a day, the rows are appending again and again for the same day, Can you please help me what is wrong here
Script
record_master_list:
load * from 'lib://Record_Master_Data\record_master_list.qvd'(qvd);
LET vListqvdexists = isnull(QvdCreateTime('lib://Record_Master_Data\record_daily_count.qvd'));
if vListqvdexists = 0 then
record_daily_count:
load * from 'lib://Record_Master_Data\record_daily_count.qvd'(qvd) where not [Extraction_Date] <> Today();
set division = 'A';
daily_report:
NoConcatenate
Load '$(division)' as 'Division', Today() as 'Extraction_Date' Resident record_master_list;
end if
if vListqvdexists <> 0 then
set division = 'A';
daily_report:
NoConcatenate
Load '$(division)' as 'Division', Today() as 'Extraction_Date' Resident record_master_list;
end if
set division = 'B';
daily_report:
Concatenate(daily_report)
Load '$(division)' as 'Division', Today() as 'Extraction_Date' Resident record_master_list;
if vListqvdexists = 0 then
record_daily_count:
Concatenate(record_daily_count)
load * Resident daily_report;
store daily_report into 'lib://Record_Master_Data\record_daily_count.qvd'(qvd);
drop table daily_report;
end If
if vListqvdexists <> 0 then
store daily_report into 'lib://Record_Master_Data\record_daily_count.qvd'(qvd);
end if
where not [Extraction_Date] <> Today();
This is a double negative, could be
where [Extraction_Date] = Today();
Hi,
Try this. With the where statement you can filter out the rows.
record_master_list:
Load
*
From 'lib://Record_Master_Data\record_master_list.qvd'(qvd);
// Do your transformations
Final_record_master_list:
Load
*
Resident [record_master_listX]
Where Floor(Extraction_Date) <> Floor(Today())
;
Store Final_record_master_list INTO 'lib://Record_Master_Data\record_master_list.qvd'(qvd);
Jordy
Climber
No JordyWegman, I wanted to read always record_master_list and compute the daily count reference in record_daily_count , But I am having the problem that record_daily_count should have only 1 record for today's count irrespective of the number of times I run the script on the same day
where not [Extraction_Date] <> Today();
This is a double negative, could be
where [Extraction_Date] = Today();
You saved me and the issue was with this. Thanks for identifying this
Glad I helped !