Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can I create a QVD under certain conditions?
Like if I have table With months data and i want to create the QVD only when month value is JANUARY.
Yes Ankit,
you can.
Just use WHERE or IF ...THEN ...ELSE condition
This just need to peek month to evaluate
best regards
Chris
Yes you can.. You can use where condition like SQL...
Tablename.QVD (qvd) Where MonthName='Jan';
Thanks,
Selvakumar
Sorry Selvakumar
but this will store only records where month is january.
I think the goal is to stroe a whole qvd when the current month is january
Best regards
Chris
Create a variable for Currentmonth and use if condition before load script...
If (vCurrentMonth=Yes) then Load * from table.. else Exit Script;
You have to calculate the month you want in that variable
Selva
hi you can try this
orginaltable :
Load *,
num(TxnDate) as TestDate
from xxx;
maxtable:
max(TestDate) as MaxDateNum
resident orginaltable;
let vMaxDate = peek('MaxDateNum',0,'maxtable');
Drop table maxtable;
let vComment=if(Month(date($(vMaxDate)))='Jan' and Year(date($(vMaxDate)))=Year(date(today())) ,' ' ,'//');
$(vComment) store orginaltable into C:\path..;
drop table orginaltable ;
or else you can use if and else loop also
regards
Premhas
Hi Chris,
This is my script.
Temp:
LOAD PK_DMA_ID,
FK_HDZ_ID,
MAINS_LENGTH_MT,
Month as M
FROM
(biff, embedded labels, table is Sheet1$);
I want to create the QVD for the records of month January only. How should I use if else or where condition?
Yes you can do it by using precedent load like this
Temp:
load * where numM = 1;
LOAD PK_DMA_ID,
FK_HDZ_ID,
MAINS_LENGTH_MT,
Month as M,
num(Month) as numM
FROM
(biff, embedded labels, table is Sheet1$);
hope it helps
Hi Ankit,
Try like this
Temp:
LOAD PK_DMA_ID,
FK_HDZ_ID,
MAINS_LENGTH_MT,
Month as M
FROM
(biff, embedded labels, table is Sheet1$)
Where Month = 'January';
** Replace January with your month name (Jan or 1 or January)
Regards,
Jagan.