Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Tags (1)
4 Replies
MVP
MVP

Re: Load column with a hardcoded value

LOAD

     ID,

     Value,

     'ONE_YEAR' AS Period

FROM YourTableSource;

Not applicable

Re: Load column with a hardcoded value

Hi,

load inline table with two field,

ID and Period.

then make inner join for the two tables.

Re: Load column with a hardcoded value

another way

Load ID,

        Value

From Table

join

load * inline [

Period

ONE_YEAR ];

Re: Load column with a hardcoded value

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