Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table in the below format:
ID | Value |
---|---|
1 | 100 |
2 | 500 |
3 | 200 |
4 | 150 |
5 | 700 |
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:
ID | Value | Period |
---|---|---|
1 | 100 | ONE_YEAR |
2 | 500 | ONE_YEAR |
3 | 200 | ONE_YEAR |
4 | 150 | ONE_YEAR |
5 | 700 | ONE_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
LOAD
ID,
Value,
'ONE_YEAR' AS Period
FROM YourTableSource;
Hi,
load inline table with two field,
ID and Period.
then make inner join for the two tables.
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