Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All
I am trying to get the delta changes to be written to the qvd file. The QVD file i then reload in another model. So I think there are 2 options: one is just to update the delta changes, changes to the data base or then do a complete reload of the QVD.
Let me know if I am on the correct path.
This is my script below, it does not seem to work:
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';
LIB CONNECT TO '123456 (administrator)';
LET lastReloadTime = ReloadTime();
Combined:
LOAD "name",
season,
supplier,
"sales_week"
FROM [lib://QVDDATA/1812.QVD]
(qvd);
Concatenate(Combined)
Load "name",
season,
supplier,
"sales_week"
FROM ExportersDB.dbo."v_sales_data_combined"
Where (Calendardate >$(lastReloadTime));
STORE Combined INTO [lib://QVDDATA/1812.QVD] (qvd);
depending on what you're going to do: update and insert
you need to identify the data that changed
and by that date Calendardate you're going to identify that data.
Hi,
If I understand you request you want to do an "Insert and Update".
with this code :
you're going to load the QVD data on which you're going to add the modified data after your "lastReloadTime" data.
LIB CONNECT TO '123456 (administrator)';
LET lastReloadTime = ReloadTime();
Combined:
LOAD "name",
season,
supplier,
"sales_week"
FROM [lib://QVDDATA/1812.QVD]
(qvd);
Concatenate(Combined)
Load "name",
season,
supplier,
"sales_week"
FROM ExportersDB.dbo."v_sales_data_combined"
Where (Calendardate >$(lastReloadTime));
STORE Combined INTO [lib://QVDDATA/1812.QVD] (qvd);
except you didn't make any update.
For what you're going to do, you need to identify the key of your table.
I propose these modifications
note that the Calendardate date corresponds to the modification date
New code:
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';
LIB CONNECT TO '123456 (administrator)';
LET lastReloadTime = ReloadTime();
Combined:
Load
PrimaryKey,
"name",
season,
supplier,
"sales_week"
FROM ExportersDB.dbo."v_sales_data_combined"
Where (Calendardate >=$(lastReloadTime));
concatenate
LOAD
PrimaryKey,
"name",
season,
supplier,
"sales_week"
FROM [lib://QVDDATA/1812.QVD] (qvd)
WHERE NOT Exists(PrimaryKey);
STORE Combined INTO [lib://QVDDATA/1812.QVD] (qvd);
No picture attached !
No
Lets try again:
change : Where (Calendardate >=$(lastReloadTime));
to
Where (Calendardate >='$(lastReloadTime)');
and try ?
still , nope
and also get this is tne output: