Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
When I generated below it doesn't work. How do I use back the variable I just set, thanks.
LOAD
[Open Date],
If(year([Open Date])=year(now()) and month([Open Date])=month(now())-1, 'Yes','No') as [V1-5],
If([V1-5] = 'No', 'Exclude', 'Include') as [Exclude?]
LOAD
*,
If([V1-5] = 'No', 'Exclude', 'Include') as [Exclude?]
;
This statement must be above previous load statement. And from is not required. As gysbert mentioned.
With a preceding load. The new field [V1-5] has to exist before you can use it.
LOAD
*,
If([V1-5] = 'No', 'Exclude', 'Include') as [Exclude?]
;
LOAD
[Open Date],
If(year([Open Date])=year(now()) and month([Open Date])=month(now())-1, 'Yes','No') as [V1-5],
.... other fields
FROM
...somewhere
Do you mean define [V1-5] first because what you wrote above is the other way around.
Also, when I load again, do I need to load the data again and after FROM do I need to point back to the data source
Refer Preceding Load for preceding load.
In Preceding Load below code will be executed first
LOAD
[Open Date],
If(year([Open Date])=year(now()) and month([Open Date])=month(now())-1, 'Yes','No') as [V1-5],
.... other fields
FROM
...somewhere
then
LOAD
*,
If([V1-5] = 'No', 'Exclude', 'Include') as [Exclude?]
;
It takes input from previous load.
LOAD
[Open Date],
If(year([Open Date])=year(now()) and month([Open Date])=month(now())-1, 'Yes','No') as [V1-5],
.... other fields
FROM
[source path]
then
LOAD
*,
If([V1-5] = 'No', 'Exclude', 'Include') as [Exclude?]
;
FROM
[ What should I write here??]
LOAD
*,
If([V1-5] = 'No', 'Exclude', 'Include') as [Exclude?]
;
This statement must be above previous load statement. And from is not required. As gysbert mentioned.