Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a Date field and the format is 01.01.2011. Now i am converting the date format in script as
Date(Mydate, 'MM-YYYY') as Period.
Now in data in have data from 2011 and i need only from 2017.
For that i am giving condition as
Load *,
From qvd where Mydate>= '01-2017'
But for some how it is not working.
Can you please tell me where i am missing..
Thanks,
Bharat
First thing... make sure to use MonthStart when you just display MM-YYYY so that the date is converted to the 1st day of the month
Date(MonthStart(Mydate), 'MM-YYYY') as Period
Next try this
Load * From qvd Where Period >= MakeDate(2017);
Although, this isn't the best way to pull data from QVD, because this isn't going to give you an optimized load... To get optimized load... try something like this
LOAD Monthstart(MakeDate(2017), IterNo() - 1) as Period AutoGenerate 1 While MakeDate(2017), IterNo() - 1 <= MonthEnd(Today()); LOAD * From qvd Where Exsits(Period);
This will not give you an optimized load.
First thing... make sure to use MonthStart when you just display MM-YYYY so that the date is converted to the 1st day of the month
Date(MonthStart(Mydate), 'MM-YYYY') as Period
Next try this
Load * From qvd Where Period >= MakeDate(2017);
Although, this isn't the best way to pull data from QVD, because this isn't going to give you an optimized load... To get optimized load... try something like this
LOAD Monthstart(MakeDate(2017), IterNo() - 1) as Period AutoGenerate 1 While MakeDate(2017), IterNo() - 1 <= MonthEnd(Today()); LOAD * From qvd Where Exsits(Period);
This will not give you an optimized load.
Hi,
Use a date type in your where condition.
Try with
... where Mydate >= Date(MakeDate(2017,1,1),'MM-YYYY');
Albert
Thank you so much Sunny Bhai.. got it..