Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Storing different years data in yearly qvds

I have the following data loaded into qlikview:

Year     ID     Value

2012     A     100

2012     B     150

2013     A     110

2013     B     140

I want to generate yearly QVDs based on the above data. e.g. in the above example there would be two QVDs generated Sample_2012.qvd and Sample_2013.qvd

11 Replies
jyothish8807
Master II
Master II

Hi,

Try putting

where Year = $(i)


Regards

KC

Best Regards,
KC
its_anandrjs
Champion III
Champion III

Hi,

If want dynamic then write like this way with for loop

A:

LOAD * INLINE [

    Year, ID, Value

    2012, A, 100

    2012, B, 150

    2013, A, 110

    2013, B, 140

    2014, C, 158

    2015, D, 458

];

MinMax:

LOAD Min(Year) as YMin, Max(Year) as YMax Resident A;

LET vMinYear = Peek('YMin', 0, 'MinMax');

LET vMaxYear = Peek('YMax', 0, 'MinMax');

For i = vMinYear to vMaxYear

     Temp:

     NoConcatenate

     load * Resident A where Year = $(i);

     STORE * from Temp into Sample_$(i).qvd; //Sample_2013

     Drop table Temp;

Next

Regards

Anand