Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to store a QVD by using store command. EVen though I am giving correct path, it is throwing error.
Here initially I am read one Qvd from the same path and renaming and saving the QVD based on some condition.
Regards,
Kumar
use this?
Let Vqvdpath = 'D:\QlikView\SourceDocuments\QVX\Mktg_Funnel_Reports\Retention\QVD Retention\';
Inserts:
LOAD * FROM
$(Vqvdpath)fact_site_visit.QVD (qvd);
MinMaxDates:
LOAD
Max(Floor(Timestamp#(site_visit_updated_datetime, 'MM/DD/YYYY hh:mm:ss.fff'))) as MaxDate
Resident Inserts;
LET vMinMonth = num(AddMonths(Peek('MaxDate'),-13));
DROP TABLE MinMaxDates;
noconcatenate // as all data is going to Inserts not to Incmonths
Incmonths:
LOAD *
Resident Inserts
WHERE site_visit_updated_datetime > '$(vMinMonth)';
STORE Incmonths into $(Vqvdpath)fact_site_visit_History.QVD (qvd);
DROP TABLE Incmonths;
use noconcatenate before Incmonths
Hi,,
As other have suggested, i would take a look at the table Incmonths.
Makes sure there is data in this table, before you are storing it.
Maybe add some traces to see if your variables are being populated correctly as well?
Mark
I think the variable vMinMonth is not setting properly check the variable values once , AddMonths function will work only on the values which is in the date format so before using this function please check the value once and set the format properly
Hi
Check whether the format for dates in both the source and variable are same.
Regards
Krishnapriya
I think your table may not be getting created. I suggest you to comment the store condition and see if the table is created or not
Inserts:
LOAD * FROM
$(Vqvdpath)fact_site_visit.QVD (qvd);
MinMaxDates:
LOAD
Max(Floor(Timestamp#(site_visit_updated_datetime, 'MM/DD/YYYY hh:mm:ss.fff'))) as MaxDate
Resident Inserts;
LET vMinMonth = num(AddMonths(Peek('MaxDate'),-13));
DROP TABLE MinMaxDates;
Incmonths:
LOAD *
Resident Inserts
WHERE site_visit_updated_datetime > '$(vMinMonth)';
//STORE Incmonths into $(Vqvdpath)fact_site_visit_History.QVD (qvd);
//DROP TABLE Incmonths;
hth
Sasi
First I have to say Thanks Colin. It is creating QVD, but it is without records. It doesn't have any records in that QVD.
your where clause is trying to compare a datetime value to a month value.
both sides of the comparison must be the same format.
WHERE site_visit_updated_datetime > '$(vMinMonth)';
Add a trace command on vMinMonth so you can see the format in the logfile.
Trace vMinMonth is $(vMinMonth) ;
Can you see this screen shot. It is writing value. I have converted site_visit_updated_datetime also Num.
Try this:
Inserts:
LOAD * FROM
$(Vqvdpath)fact_site_visit.QVD (qvd);
MinMaxDates:
LOAD
Max(Floor(Timestamp#(site_visit_updated_datetime, 'MM/DD/YYYY hh:mm:ss.fff'))) as MaxDate
Resident Inserts;
LET vMinMonth = num(AddMonths(Peek('MaxDate'),-13));
DROP TABLE MinMaxDates;
Noconcatenate
Incmonths:
LOAD *
Resident Inserts
WHERE site_visit_updated_datetime > '$(vMinMonth)';
STORE Incmonths into $(Vqvdpath)fact_site_visit_History.QVD (qvd);
DROP TABLE Incmonths;