Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load column with a hardcoded value

Hi,

I have a table in the below format:

IDValue
1

100

2500
3200
4150
5700

I need to append a column to this table which has a value hardcoded into, a default value if you will.

So the result I am trying to achieve is this:

IDValuePeriod
1100ONE_YEAR
2500ONE_YEAR
3200ONE_YEAR
4150ONE_YEAR
5700ONE_YEAR

I've googled around for a bit, seems like Inline Loads might have something to do with it, but I can't figure it out.

Any help would be much appreciated

Thanks

4 Replies
MVP
MVP

LOAD

     ID,

     Value,

     'ONE_YEAR' AS Period

FROM YourTableSource;

Not applicable

Hi,

load inline table with two field,

ID and Period.

then make inner join for the two tables.

MVP
MVP

another way

Load ID,

        Value

From Table

join

load * inline [

Period

ONE_YEAR ];

Hi,

if you can't include the additional field in your initial load of the table (e.g. because it results from a binary load or an included script file you can't change), then you can go with your second best option and join it subsequently like:

Join (YourTable)

LOAD 'ONE_YEAR' as Period

Autogenerate 1;

hope this helps

regards

Marco