Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script sintaxis conflict with '[]'

Hi ,

I am trying to load this cross table.

CrossTable(Value, Importe, 2)

LOAD F1 as Entity,

     F2 as Account,

     [<Entity Currency>],

     [<Entity Curr Adjs>],

     [<Entity Curr Total>],

     [<Parent Currency>],

     [<Parent Curr Adjs>],

     [<Parent Curr Total>],

     [Parent],

     [Parent Adjs],

     [Parent Total],

     [Proportion],

     [Elimination],

     [Contribution],

     [Contribution Adjs],

     [Contribution Total]

FROM

It gives me the following script error:

Field not found - <Parent>

CrossTable(Value, Importe, 2)

I suppose there is a problem with the original name of the field '[Parent]' because of the use of the '[]'.

Is there any way to import the field with its original name using a special caracter or similar?

Thanks.

7 Replies
Miguel_Angel_Baeyens

Hi,

What I'd say it's the problem is the "<" and ">". Make sure that these characters come from the database, otherwise clean them in the filed name.

Hope that helps.

Miguel

sushil353
Master II
Master II

Please share the sample data.. i have tested field with <>.. and it is working

Not applicable
Author

Hi,

the database original names are:

<Entity Currency>
<Entity Curr Adjs>
<Entity Curr Total>
<Parent Currency>
<Parent Curr Adjs>
<Parent Curr Total>
[Parent]
[Parent Adjs]
[Parent Total]
[Proportion]
[Elimination]
[Contribution]
[Contribution Adjs]
[Contribution Total]

If I get rid of "<" and ">" it gives me error from the very first field, that is:

<Entity Currency>

I think the problem start in [Parent].

Thanks

Not applicable
Author

Sample.

Thanks

sushil353
Master II
Master II

Hi,

Problem is with your database column headers...

in your database you have column heading with [Parent].. due to [] in your database qlilkview is not interpreting.

try to remove [] in your database.. i have removed the [] from the xl file and it is working fine..

HTH

Sushil

Not applicable
Author

Hi,

I know, this is what I am trying not to do. I am looking for a sintaxis in QV which interpret these special field names right.

Thank you any way.

flipside
Partner - Specialist II
Partner - Specialist II

Hi,

You may need to parse your column names through a routine.  The following is one method (you'll have to adjust for xlsx)...

//Get data with column names as top row of data

Data:

LOAD rowno() as rowRef, * FROM [test.xls] (biff, no labels, table is [2011$]);

//Convert top row data to column names

For c = 2 to NoOfFields('Data')

    f1 = FieldName(c,'Data');

    f2 = peek(f1,0,'Data');

    if len(f2) > 0 then

        Rename field '$(f1)' to '$(f2)';

    ENDIF;

Next c

//Drop column names

right keep (Data)

load rowRef resident Data where rowRef > 1;

Drop field rowRef;

flipside