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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load data from same row

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.

myDatemyDaymyMonthmyYear.......
18/02/201418Feb2014.......


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


1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
marcus_sommer

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