Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my script, I redefined a field as follows in order to differentiate this date field from others in the dashboard :
Date as 'CC_Date'
Now I want to create a week field based on the 'CC_Date'. However, when I use:
Week(CC_Date) as Week,
The script is coming back as invalid because of my field for week.
You can't reference your new field CC_Date in the same LOAD statement where you are creating it.
You can use the new field in a preceding LOAD
or reference the original field name:
LOAD *,
Week(CC_Date) as WeekOnNewField;
LOAD
Date as 'CC_Date' ,
Week(Date) as WeekOnOriginalField,
...
FROM ...;
Your Date field should show a numeric representation in both cases, to allow the Week() function to work.
You can't reference your new field CC_Date in the same LOAD statement where you are creating it.
You can use the new field in a preceding LOAD
or reference the original field name:
LOAD *,
Week(CC_Date) as WeekOnNewField;
LOAD
Date as 'CC_Date' ,
Week(Date) as WeekOnOriginalField,
...
FROM ...;
Your Date field should show a numeric representation in both cases, to allow the Week() function to work.