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: 
chriscools
Creator II
Creator II

adding a column to a table in the script

Hello,

i have 5 tables in excel, it is every time the same table, but with info from different projects.

The title of the project is on the firts row of every table, and the field names are in the second row. so when i load the tables i

only take the data starting from row 3 and row 2 are the the columnheads.

I would like to see the 5 tables in qlikview as different tables, but because they all have the same fieldnames, they are combined in

qlikview into one big table. and now i can't tell which record is from which project.

i was thinking about the field "projectname" to each different table in qlikview, where for each record in a table i can add for example "project software" and the next table for each record for example "project supply chain".

Can anyone help me with this?

thanx!

grtz,

chris

1 Solution

Accepted Solutions
pover
Luminary Alumni
Luminary Alumni

Chris,

The best solution is that all the tables are made into one big table because it is easier to use one big table with the same field names when you start to make charts, so you're on the right track.

The answer to adding a new column depends on how you're importing the excel files. I'll assume you have 5 different load statements for each Excel worksheet. If that's the case, adding the new column is as easy as putting the statement

'project name' as projectname

in every load statement. For example,

Load 'project supply chain' as projectname,
...
From ...;

If you are going to start adding alot of Excel worksheets, you might want to check out the forum for ideas to do a loop to load each worksheet and then creating a new column for each worksheet would be created differently.

Regards.

View solution in original post

3 Replies
pover
Luminary Alumni
Luminary Alumni

Chris,

The best solution is that all the tables are made into one big table because it is easier to use one big table with the same field names when you start to make charts, so you're on the right track.

The answer to adding a new column depends on how you're importing the excel files. I'll assume you have 5 different load statements for each Excel worksheet. If that's the case, adding the new column is as easy as putting the statement

'project name' as projectname

in every load statement. For example,

Load 'project supply chain' as projectname,
...
From ...;

If you are going to start adding alot of Excel worksheets, you might want to check out the forum for ideas to do a loop to load each worksheet and then creating a new column for each worksheet would be created differently.

Regards.

chriscools
Creator II
Creator II
Author

Hey Karl,

thank you very much! it works perfectly!

the fieldnames in the 5 tables were already the same, so in qlikview i had already one big table!

i have tried the way you said before but i uses " instead of a single ' .... 🙂

now it works fine! but only when i try to give a fieldname in two words it stil doesn't work, not even when i put them

between [ ]. off course this is a minor problem!

so thanx a lot for helping me with this!

grtz,

chris

dzrtrdr
Contributor II
Contributor II

Chris,

You should be able put your multi-work project name in single quotes and the field you are defining in double quotes, such as 'My Best Project' as "ProjectName".