Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Array to QVD

Hi

I have two array variables and aI need one qvd file wiht this two variable somethilng like this:

vLocal = "?Recife?Rio de Janeiro?Sao Paulo?Salvador"

vGerente="?Carlos Afonso?Thiago Jose?Antonio Carlos?Katia Maria"

And I need a qvd file like

Local                     Gerente

Recife                    Carlos Afonso

Rio de Janeiro         Thiago Jose

Sao Paulo               Antonio Carlos

Salvador                  Katia Maria

How can I do this?

1 Solution

Accepted Solutions
rubenmarin
Not applicable

Re: Array to QVD

Hi Luiz Fernando, you can use an script like this:

SET vLocal = "?Recife?Rio de Janeiro?Sao Paulo?Salvador";

SET vGerente="?Carlos Afonso?Thiago Jose?Antonio Carlos?Katia Maria";

LET vNumValues=SubStringCount('$(vLocal)', '?');

For i=2 to vNumValues+2

    data:

    LOAD SubField('$(vLocal)', '?', $(i)) as Local,

        SubField('$(vGerente)', '?', $(i)) as Gerente

    AutoGenerate 1;

next

STORE data into data.qvd(qvd);

3 Replies
rubenmarin
Not applicable

Re: Array to QVD

Hi Luiz Fernando, you can use an script like this:

SET vLocal = "?Recife?Rio de Janeiro?Sao Paulo?Salvador";

SET vGerente="?Carlos Afonso?Thiago Jose?Antonio Carlos?Katia Maria";

LET vNumValues=SubStringCount('$(vLocal)', '?');

For i=2 to vNumValues+2

    data:

    LOAD SubField('$(vLocal)', '?', $(i)) as Local,

        SubField('$(vGerente)', '?', $(i)) as Gerente

    AutoGenerate 1;

next

STORE data into data.qvd(qvd);

Not applicable

Re: Array to QVD

Hi Ruben

It works fine , thanks

rwunderlich
Not applicable

Re: Array to QVD

You don't need a FOR loop. If you use only two parameters to subfield(), QV will automatically generate mutiple rows.

    data:

    LOAD SubField('$(vLocal)', '?') as Local,

        SubField('$(vGerente)', '?') as Gerente

    AutoGenerate 1;

-Rob

http://masterssummit.com

http://robwunderlich.com