Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

Inputfield in loadscript

I use this script

Inputfield testfield;

Tablename:

Load *,

testfield;

SQL select

A,

B,

C,

D

From tablename;

I get an error message field <testfield> unknown and  I do not understand why.

Changing the order (load testfield, * ) does not help

Your help is appreciated

11 Replies
florentina_doga
Partner - Creator III
Partner - Creator III

try this

Tablename:

Load *

SQL select

A,

B,

C,

D

From tablename;

Inputfield testfield;

noconcatenate

table2:

load *, testfield

resident Tablename;

drop table Tablename

hope this help.

marcus_sommer

Your inputfield must be a real field either from the sql or created new with an alias:

Inputfield testfield;

Tablename:

Load *,

0 as testfield;

SQL select

A,

B,

C,

D,

testfield 

From tablename;

- Marcus

sunny_talwar

May be try this:

Inputfield testfield;

Tablename:

LOAD *,

          0 as testfield;

SQL select

A,

B,

C,

D

From tablename;

tamilarasu
Champion
Champion

You can also try,

INPUTFIELD testfield;

Tablename:

SQL select

A,

B,

C,

D,

'' as testfield

From tablename;

richard_chilvers
Specialist
Specialist

Hi Marcus

I have never used INPUTFIELD, but it looks handy, so I thought I'd do some testing.

This is my script, which seems very similar to yours, but produces an error (Duplicate Keys). I must be misunderstanding, but could you explain ?

Thanks

INPUTFIELD Quantity;
LOAD *, 0 AS Quantity
INLINE [
F1, Quantity1
1, 0
3, 0
1, 0
23, 0
15, 0
]
;

marcus_sommer

The assignment from a inputfield value within the table (not absolutely sure but I believe within the whole datamodel) must be absolutely unique which is not given in your example (I have marked it with a bigger font):

INPUTFIELD Quantity;
LOAD *, 0 AS Quantity
INLINE [
F1, Quantity1
1, 0
3, 0
1, 0
23, 0
15, 0
]
;

- Marcus

richard_chilvers
Specialist
Specialist

Ah, OK Marcus, thanks for your prompt response.

curiousfellow
Specialist
Specialist
Author

Thank you all for your answer. As soon as I return from holidays I will try to look further

Mahamed_Qlik
Specialist
Specialist

Hi Curiousfellow,

Before commentiong, I would like to know, does you table has field named as testfield ?

Regards,

Mahamed