Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
jjohnstonti618
Contributor III
Contributor III

applying UPPER to source excel file header

Hi,

This should be simple, but I am still running into script errors.  I have a source excel file with fields Length 1, Width 1, Height 1, Length 2, Width 2, Height 2.  This file is created by end users and then loaded into a folder to be loaded.  Sometimes these end users mess up capitalization and input column names such as LEngth 1, or WIDTH 1, or height 1.  I want qlikview to simply recognize the UPPER of whatever they input as the field names so they load in without error, and then rename each back to their correct case (Weight 1) so that the rest of the script utilizing these fields doesnt also have to be changed.

One thing to note, several of these fields are variables based on a particular input variable (vCount) the user selects before even loading the dashboard.  This is necessary because not all rows in my excel file even have Length2, Width2, Height 2, etc etc... I only want to look for 2,3,4,5,6 etc if they are actually populated...otherwise just look at 1.

For example, here is the code that i run BEFORE even loading in the excel file:

IF vCount >= 1 then

   set Length1          = '[Length 1]';

   set Width1           = '[Width 1]';

   set Height1          = '[Height 1]';

else

   set Length1          = null();

   set Width1           = null();

   set Height1          = null();

END IF

IF vCount >= 2 then

   set Length2         = '[Length 2]';

   set Width2           = '[Width 2]';

   set Height2          = '[Height 2]';

else

   set Length2          = null();

   set Width2           = null();

   set Height2          = null();

END IF

/*Now the actual excel load*/

LoadFromExcel:

LOAD ProductID

   ,      $(Length1) as      [Length1]

   ,      $(Width1) as       [Width 1]

   ,      $(Height1) as      [Height 1]

   ,      $(Length2) as      [Length 2]

   ,      $(Width2) as       [Width 2]

   ,      $(Height2) as      [Height 2]

FROM

(ooxml, embedded labels, table is [Sheet1]);




Bottom line, this load runs perfectly as long as the end user types in the excel column names EXACTLY right (Length 1 with the space in between Length and 1, capital L, etc)  How can I apply UPPER code (or something else) to the above sample of code so that qlikview ignores the capitalization of LEngth 1, width 1, HEIGHT 1, and only looks at the spelling and spacing? i think the use of variables beforehand are messing me up.

0 Replies