- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Load field with changing name due to typo in Excel
Hi guys,
I am loading this Excel into Qlikview and due to the fact that 2 versions of an Excel are going around, sometimes a field that I want to load is called Numbers and another time it is called Numers (due to a typo in the Excel).
Now my question is, is it possible to load either Numbers or Numers, without having to go in the script to everytime to make the change manually?
E.g. Sometimes it would look like this (with Numbers):
[Data]:
LOAD Name,
Numbers
FROM
[......xlsx]
(ooxml, embedded labels, table is [Netherlands]);
And sometimes it will look like this (with Numers):
[Data]:
LOAD Name,
Numers
FROM
[......xlsx]
(ooxml, embedded labels, table is [Netherlands]);
Can somebody help me with figuring out how to do this?
Thanks 🙂
- Tags:
- qlikview_scripting
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could ignore the header field, and rename them correctly by pulling in the data without it. i.e A as Number, B as ... This way, regardless of the excel file, you would not see a fail. This would be dependant on both excel files having the same column arrangement, but otherwise should resolve the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To ignore script failed. You can manage with Alt() like
[Data]:
LOAD Name,
Alt(Numbers,Numers) as Common
FROM
[......xlsx]
(ooxml, embedded labels, table is [Netherlands]);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anil,
If I run
[Data]:
LOAD Name,
Alt(Numbers,Numers) as Common
FROM
[......xlsx]
(ooxml, embedded labels, table is [Netherlands]);
I get an error message saying:
Field not found - <Numers> when I load an Excel with Numbers as field name or Field not found - <Numbers> when I load an Excel with Numers as field name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is that only one field you will get different?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes that is the only field.
So only that column header can change between Numers and Numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could ignore the header field, and rename them correctly by pulling in the data without it. i.e A as Number, B as ... This way, regardless of the excel file, you would not see a fail. This would be dependant on both excel files having the same column arrangement, but otherwise should resolve the issue