Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
MCampestrini
Valued Contributor

Creating multiple QVD files based on a SQL Query

Hi!

I have a SQL query that brings a field called "Year" with multiple values (for example, 2012, 2013, 2014). I would to generate various QVD files, one for each year. Does anyone have any examples of how to do this?

Thanks in advance!!

Márcio Rodrigo Campestrini
Tags (4)
1 Solution

Accepted Solutions
luis_pimentel
Contributor III

Re: Creating multiple QVD files based on a SQL Query

Try something like:

FOR vYear=2012 TO 2014

  

     TempTable:

     LOAD * FROM yourtable WHERE Year = vYear;

     STORE TempTable INTO '$(vYear)'.qvd (qvd);

NEXT;

Update: Not sure if in the WHERE clausule you nedd Year = vYear or Year = $(vYear)

1 Reply
luis_pimentel
Contributor III

Re: Creating multiple QVD files based on a SQL Query

Try something like:

FOR vYear=2012 TO 2014

  

     TempTable:

     LOAD * FROM yourtable WHERE Year = vYear;

     STORE TempTable INTO '$(vYear)'.qvd (qvd);

NEXT;

Update: Not sure if in the WHERE clausule you nedd Year = vYear or Year = $(vYear)

Community Browser