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: 
hkg_qlik
Creator III
Creator III

DATA Display

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_WIDCALENDAR_DATECAL_HALFCAL_MONTHCAL_QTRCAL_WEEKCAL_YEAR
200501011/1/200511112005
200501021/2/200511122005
200501031/3/200511122005
200501041/4/200511122005
200501051/5/200511122005

Thanks ,

H

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

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";

View solution in original post

4 Replies
johnw
Champion III
Champion III

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";

hkg_qlik
Creator III
Creator III
Author

Hi John,

Thanks for solving the issue. It works!!

Regards,

H

hkg_qlik
Creator III
Creator III
Author

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

Not applicable

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.