Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have date field.
I extracted the month from this date using Month(Date) as named the field as My_Month.
My_Month will have the values
Jan
Feb
Mar
Apr.
I want this months to get mapped against Quarter.
So i used applymap function.
Month_Quarter_Mapping:
Mapping Load * Inline
[
Jan,Q1
Feb,Q1
Mar,Q1
Apr,Q1
May,Q1
Jun,Q2
];
Note: My requirement is Jan-May Q1.
I used
applymap('Month_Quarter_Mapping',My_Month) as My_Quarter.
My_Quarter is also showing
Jan
Feb
Mar
May.
I wanted it to show
Q1
Q1
Q1
Q1
Q2
instead.
Could anyone help me on this.
Thanks!
Or replace your month names with numbers in your mapping table:
Month_Quarter_Mapping:
Mapping Load * Inline
[
1,Q1
2,Q1
3,Q1
4,Q1
5,Q1
6,Q2
];
First you have to name your fields in the inline table.i.e Month,Quarter
Month_Quarter_Mapping:
Mapping Load * Inline
[
My_Month,My_Quarter
Jan,Q1
Feb,Q1
Mar,Q1
Apr,Q1
May,Q1
Jun,Q2
];
Hi,
You can use:
'Q'&Ceil(Month(Date(YOURDATEFIELD),'DD/MM/YYYY'))/3) as "Quarter"
'Q' & Ceil(Month(Date)/3) as Quarter should do the trick
But my requirement is bit different.
Jan-May as Q1
Jun-Jul as Q2
Aug-Sep as Q3
Oct-Dec as Q4
try to define ur months in mapping load table
Mapping Load * Inline [
Month,Quarter
Jan ,Q1
Feb,Q1
..........
Jun,Q2
];
then do applymap from this table to ur calender date table
Jebamalai is correct, if you use his code, to add the headers,
Month_Quarter_Mapping:
Mapping Load * Inline
[
My_Month,My_Quarter
Jan,Q1
Feb,Q1
Mar,Q1
Apr,Q1
May,Q1
Jun,Q2
];
then use your code in your load statement,
applymap('Month_Quarter_Mapping',My_Month) as My_Quarter.
In front end, your My_Quarter details should display as Q1, etc.
Ya i tried the same but still i am getting the Quarter as Jan,Feb,Mar,Apr,May ,Jun instead of Q1,Q1,Q1,Q1,Q1,Q2.
Can you post your sample qvw?
can you send the updated code you are using?