Year Wise Qvd creation from Source Data


    Source:

    LOAD * From Source;


    YearCount:
    LOAD Year as TotYr Resident Source;

    LET vYearMin = Peek('TotYr',0,'YearCount');
    LET vYearMax = Peek('TotYr',-1,'YearCount');


    Drop Table YearCount;

    Drop Table Source;


    FOR vTableName = $(vYearMin) to $(vYearMax)
    //////////
    NoConcatenate
    $(vTableName):


    LOAD * From Source.qvd (Qvd) Where Year = $(vTableName);
    STORE $(vTableName) into $(vTableName).qvd;

    DROP Table $(vTableName);


    NEXT