Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a TIME_DIMENSION Table which I am pulling from a Data Warehouse. One of the Column name is CAL_QTR as shown below.
FYI: CAL_QTR is Quarter value. But I want to change it to Q1, Q2, Q3 and Q4 instead of 1, 2, 3 & 4 on the reports.
What changes should be done in the script I am using as shown below:
LOAD "ROW_WID",
"CALENDAR_DATE",
"CAL_HALF",
"CAL_MONTH",
"CAL_QTR",
"CAL_WEEK",
"CAL_YEAR";
SQL SELECT "ROW_WID",
"CALENDAR_DATE",
"CAL_HALF",
"CAL_MONTH",
"CAL_QTR",
"CAL_WEEK",
"CAL_YEAR"
FROM ODS."W_XXMSC_DAY_D";
ROW_WID | CALENDAR_DATE | CAL_HALF | CAL_MONTH | CAL_QTR | CAL_WEEK | CAL_YEAR |
20050101 | 1/1/2005 | 1 | 1 | 1 | 1 | 2005 |
20050102 | 1/2/2005 | 1 | 1 | 1 | 2 | 2005 |
20050103 | 1/3/2005 | 1 | 1 | 1 | 2 | 2005 |
20050104 | 1/4/2005 | 1 | 1 | 1 | 2 | 2005 |
20050105 | 1/5/2005 | 1 | 1 | 1 | 2 | 2005 |
Thanks ,
H
If I understood the question:
LOAD "ROW_WID",
"CALENDAR_DATE",
"CAL_HALF",
"CAL_MONTH",
'Q' & "CAL_QTR" as "CAL_QTR",
"CAL_WEEK",
"CAL_YEAR";
SQL SELECT "ROW_WID",
"CALENDAR_DATE",
"CAL_HALF",
"CAL_MONTH",
"CAL_QTR",
"CAL_WEEK",
"CAL_YEAR"
FROM ODS."W_XXMSC_DAY_D";
If I understood the question:
LOAD "ROW_WID",
"CALENDAR_DATE",
"CAL_HALF",
"CAL_MONTH",
'Q' & "CAL_QTR" as "CAL_QTR",
"CAL_WEEK",
"CAL_YEAR";
SQL SELECT "ROW_WID",
"CALENDAR_DATE",
"CAL_HALF",
"CAL_MONTH",
"CAL_QTR",
"CAL_WEEK",
"CAL_YEAR"
FROM ODS."W_XXMSC_DAY_D";
Hi John,
Thanks for solving the issue. It works!!
Regards,
H
Hi,
'Q' & "CAL_QTR" as "CAL_QTR",
if I do the above mentioned change to my script I get Q1, Q2, Q3 and Q4 as the output.
For example: I want the output as Q 1, Q 2 or Q - 1, Q-2....what changes I need to make in the above script? (adding space in between Q and 1 or placing '-' between Q and 1)
Thanks,
H
Hi
You can replace the Q in 'Q' & "CAL_QTR" as "CAL_QTR",
with anything you want. E.g. 'Q ' or 'Q-' or 'Q - ' 'Quarter - ' etc.