Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm loading a table similar to the following:
Temp01:
Crosstable(FiscalPeriodTemp, Data, 1)
LOAD
ASDF as Key,
ASD01 as 201301,
ASD02 as 201302,
...
SQL SELECT *
FROM <ODBC Table>
where
QWER =2013;
NoConcatenate
Temp02:
LOAD
Key,
Data,
Date#(FiscalPeriodTemp, 'YYYYMM') as FiscalPeriod
Resident Temp01;
Drop Table Temp01;
Currently the script functions as intended, however I need to re-alias the Fiscal Periods for each year. Is there a way to set my Alias via variable or by concatenating two fields?
i.e.
Set vTempDate = 2013
...
ASD01 as $(vTempDate) & '01', <Doesn't Work>
or
ASD01 as QWER & '01',
This should work- there are no quotes around the alias.
Set vTempDate = 2013 ;
...
ASD01 as $(vTempDate)01,
ASD02 as $(vTempDate)02,
This should work- there are no quotes around the alias.
Set vTempDate = 2013 ;
...
ASD01 as $(vTempDate)01,
ASD02 as $(vTempDate)02,
Also, if you have spaces in there or other special characters you can safely add square brackets as in this example:
let vAlias = 'Min';
Dates:
load Distinct
min(Date) as [$(vAlias)Date],
max(Date) as MaxDate
from <source>
creates 'MinDate' and 'MaxDate' fields