Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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.
Not applicable

Loading query

Hi All,

I need to load multiple data tables containing the same fields, each for a different client, example below:

ClientAAAA
DateBalanceFee
23-May50100
24-May60120
25-May100200
26-May50100
27-May4080
28-May100200
29-May50100

Anyone know of a way when loading of adding the client name to each row of data in the table without having to go into each sheet and adding an additional 'client' column as below?

ClientAAAA
ClientDateBalanceFee
AAAA23-May50100
AAAA24-May60120
AAAA25-May100200
AAAA26-May50100
AAAA27-May4080
AAAA28-May100200
AAAA29-May50100

thanks in advance,

James

1 Solution

Accepted Solutions
Not applicable

Re: Loading query

Helo James,

You can subscribe to the blog.

The following PDF file with the tutorial.

Best Regards.

Tonial.

6 Replies
rahulgupta
Contributor III

Loading query

Hey hi,

Just Use the Code as follows:

Load *,

        'AAAA' as ClientName

From Table;

Load*,

       'BBBB' as ClientName

From Table;

and so on..........

Hope this helps...         

Regards

Not applicable

Re: Loading query

You can see in the blog community Toccato. I posted about it today. Only in Portuguese.

Blog Toccato

Best Regards.

Tonial.

Not applicable

Re: Loading query

Thanks for the responses.  Unfortunately I am unable to access the linked blog.

My initial question was a little unclear, so I will clarify what I am trying to achieve.

I have multiple spreadsheets each for a different client in the following format:

Client

AAAA
DateBalanceFee
23-May50100
24-May60120
25-May100200
26-May50100
27-May4080
28-May100200
29-May50100

I am looking for some code that will pick up the client in cell B1 and produce a Qlikview table as follows:

ClientDateBalanceFee
AAAA23-May50100
AAAA24-May60120
AAAA25-May100200
AAAA26-May50100
AAAA27-May4080
AAAA28-May100200
AAAA29-May50100

Thanks again,

James

flipside
Valued Contributor II

Re: Loading query

Hi James

Try something like this, basically just reads the top line of the spreadsheet, passes the value of col B to a variable to use in the secondary load.  All the sheets will need to be same format etc..

Temp:
LOAD
  A, //col A
     B, //col B
     C //col C
FROM
[Clients.xlsx]
(ooxml, no labels, table is Sheet1)
Where rowno()=0;

LET vClient=FieldValue('B',1);

DROP TABLE Temp;

Data:
LOAD
'$(vClient)' as Client,
A as Date,
B as Value,
C as Fee
FROM
[Clients.xlsx]
(ooxml, no labels, header is 4 lines, table is Sheet1);

flipside

Not applicable

Re: Loading query

Helo James,

You can subscribe to the blog.

The following PDF file with the tutorial.

Best Regards.

Tonial.

Not applicable

Re: Loading query

Thanks guys,

Have just followed the steps in the PDF and it does exactly what I want, much appreciated.

Will give the other method a try too.

Cheers,

James

Community Browser