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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
4 Replies
swuehl
Champion III
Champion III

LOAD

     ID,

     Value,

     'ONE_YEAR' AS Period

FROM YourTableSource;

Not applicable
Author

Hi,

load inline table with two field,

ID and Period.

then make inner join for the two tables.

Kushal_Chawda
MVP
MVP

another way

Load ID,

        Value

From Table

join

load * inline [

Period

ONE_YEAR ];

MarcoWedel
MVP
MVP

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