Discussion Board for collaboration on QlikView Scripting.
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.
Just use WHERE or IF ...THEN ...ELSE condition
This just need to peek month to evaluate
Yes you can.. You can use where condition like SQL...
Tablename.QVD (qvd) Where MonthName='Jan';
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
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
hi you can try this
num(TxnDate) as TestDate
max(TestDate) as MaxDateNum
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
This is my script.
Month as M
(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
load * where numM = 1;
Month as M,
num(Month) as numM
hope it helps
Try like this
(biff, embedded labels, table is Sheet1$)
Where Month = 'January';
** Replace January with your month name (Jan or 1 or January)