Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
andries_bos
Creator II
Creator II

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
hic
Former Employee
Former Employee

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