Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have tried various functions (Peek and Previous for example) However I can not achieve the desired results.
For simplicity sake, assume I am loading a table with one record/row of data with several columns.
myDate | myDay | myMonth | myYear | ... | .... |
---|---|---|---|---|---|
18/02/2014 | 18 | Feb | 2014 | ... | .... |
Load
Date(date) as myDate,
Day(date) as myDay,
Month(date) as myMonth,
Year(date) as myYear,
...
What function (or other trick) should I use to directly refer to another previously column on the same row. For example if I want to calculate something based on the 18 in the day column without having to repeat the Day(date) part again?
Thanks
Oli
Hi
I think the OP is referring to using the output value of one field in another calculated field. If I am correct, then what is needed is a preceding load:
Load *,
<some calculaton based on myDay or myDate> As .....
;
Load
Date(date) as myDate,
Day(date) as myDay,
...
HTH
Jonathan
Hi
I think the OP is referring to using the output value of one field in another calculated field. If I am correct, then what is needed is a preceding load:
Load *,
<some calculaton based on myDay or myDate> As .....
;
Load
Date(date) as myDate,
Day(date) as myDay,
...
HTH
Jonathan
You could also load data with ColumnNo (no labels). In some cases - depending on the source - is it possible to mix up labels and ColumnNo.
Simplifying is good but I suggest you should not take any short cut - the script should be readable and need later maintance ...
- Marcus