Documents for QlikView related information.
//Yearly QVD: TempTable:LOAD Distinct Year(Date) AS YearFROM QVD\Main.qvd(qvd) Order by Year(Date) asc;NoConcatenate Table:Load Year,Min(Year) as minYear, max(Year) as maxYearResident TempTable;Let vMin=Peek('minYear', 0, 'Table');Let vMax=Peek('maxYear', 0, 'Table');FOR i=$(vMin) to $(vMax)LET vYear = Peek('Year',$(i),'Table'); YearWise:NoConcatenateLOAD * FROM QVD\Main.qvd(qvd) Where Year(Date) = '$(vYear)';STORE YearWise into TableName_$(vYear).qvd;DROP Table YearWise;NextDROP Table TempTable;DROP Table Table;
You can read the same here for yearly QVD creations. With exactly same logic used before in my documents.
Year Wise Qvd creation from Source Data
Are you sure that your min max calculation will work?
Correct me if I'm wrong. Grouping by year will make both min and max to be the same? I would suggest removing the group by statement.
Load Min(Year) as minYear, max(Year) as maxYear
If you are grouping by year the Min and Max of years will give the same value.
So vMin and vMax will hold same values.
So the splitting of years will not work i think.
Thanks Vegar and Avinash
Replace below Load Year,Min(Year) as minYear, max(Year) as maxYearResident TempTable;
Load Min(Year) as minYear, max(Year) as maxYearResident TempTable;