Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have month and column values such as:
Quarter | Month |
Q1 | Jan |
Q1 | Feb |
Q1 | Mar |
Q2 | Apr |
Q2 | May |
Q2 | June |
Q3 | July |
and so on..
Now I want to add a 3rd column that has values like:
Quarter | Month | QMonth |
Q1 | Jan | Jan |
Q1 | Feb | Feb |
Q1 | Mar | Mar |
Q1 | Jan | Q1 |
Q1 | Feb | Q1 |
Q1 | Mar | Q1 |
Q2 | Apr | Apr |
Q2 | May | May |
Q2 | June | June |
and so on...
How do I add this third column QMonth.
Thanks!!
Try:
t1:
LOAD Quarter,
Month,
Month as QMonth
FROM
[https://community.qlik.com/t5/QlikView-App-Development/Generate-a-column-that-has-combination-of-month-and-quarter/td-p/1676455]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);
Load
Quarter,
Month,
'Q'&Ceil(Month(Date#(Month, 'MMM'))/3) as QMonth
Resident t1;
What if you do like this?
Calendar:
Load
*,
Quarter as QMonth
From Calendar;
Concatenate Load
*,
Month as QMonth
From Calendar;
Try:
t1:
LOAD Quarter,
Month,
Month as QMonth
FROM
[https://community.qlik.com/t5/QlikView-App-Development/Generate-a-column-that-has-combination-of-month-and-quarter/td-p/1676455]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);
Load
Quarter,
Month,
'Q'&Ceil(Month(Date#(Month, 'MMM'))/3) as QMonth
Resident t1;
What if you do like this?
Calendar:
Load
*,
Quarter as QMonth
From Calendar;
Concatenate Load
*,
Month as QMonth
From Calendar;
Using both the solutions, the data is like:
Quarter | Month | Qmonth |
Q1 | Oct | Q1 |
Q1 | Nov | Q1 |
Q1 | Nov | Q2 |
Q1 | Dec | Q1 |
Q1 | Dec | Q3 |
Q2 | Jan | Q2 |
Q2 | Jan | Q4 |
Q2 | Feb | Q2 |
Q2 | Feb | Feb |
Q2 | Mar | Q2 |
Q2 | Mar | Mar |
Q3 | Apr | Q3 |
Q3 | Apr | Apr |
Q3 | May | Q3 |
Q3 | May | May |
Q3 | Jun | Q3 |
Q3 | Jun | Jun |
Q4 | Jul | Q4 |
Q4 | Jul | Jul |
Q4 | Aug | Q4 |
Q4 | Aug | Aug |
Q4 | Sep | Q4 |
Q4 | Sep | Sep |
I don't see how that result I possible for neither mine or @tresesco suggested solution. You must be doing something else as well. Please share script and a screenshot of your data model with focus around your calendar.
Even my understanding thought of the solution you suggested, seemed quite straight forward solution, but unable to figure what's wrong. Let me check other things here as well.
Got It!! Wrapped Quarter in Text and this worked... Not sure of the issue, but at least I get the solution.
Thanks alot!!