Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

andriesb
Contributor

concatenate and cascade load

I have 4 different qvs files that I concatenate to one big table.

I have to add calculated field info into the resulting tabel.

What is best to do:

Case 1

InvoicesTemp:

Load *,

  Text(Field1) AS Customer

FROM [$(vpath.QVDSource)InvoiceList 2012.qvd] (qvd);

InvoicesTemp:

Concatenate Load *,

  Text(Field1) AS Customer

FROM [$(vpath.QVDSource)InvoiceList 2013.qvd] (qvd);

Invoices:

Load *,

if Amount > 100, high, low AS Type

resident InvoicesTemp;

(working with .temp qvs does not word except as I add an additional calculated field... )

OR

case 2

could I add this step

'if Amount > 100, high, low AS Type' to each load? What should be the correct syntax in the second case:

not using the 'temp' tabel and add the calculated field to each concat load...

Invoices:

Load *,

if Amount > 100, high, low AS Type;

Concatenate Load *,

  Text(Field1) AS Customer

FROM [$(vpath.QVDSource)InvoiceList 2012.qvd] (qvd);

Is this correct syntax the achieve the same result?

regards

1 Reply
Employee
Employee

Re: concatenate and cascade load

I would do the following:

Set vConcatenate = ;

For vYear = 2012 to 2013

          Invoices:

          $(vConcatenate)

          Load *,

                 Text(Field1) as Customer,

                 if (Amount > 100, 'high', 'low') as Type

                 FROM [$(vpath.QVDSource)InvoiceList $(vYear).qvd] (qvd);

          Set vConcatenate = Concatenate;

Next vYear

HIC

Community Browser