cancel
Showing results for 
Search instead for 
Did you mean: 

hana caluclated column

Former Member
0 Kudos

How to add automatically months to a quarter column, for example if it's 20122 then it should automatically add 201204, 201205,201206.

Can we generate using caluclated column if we have quarter ?

Accepted Solutions (1)

Accepted Solutions (1)

BenedictV
Active Contributor
0 Kudos

hi Ram,

What is the logic here? Appending the month at end is not the problem here. But how would the system know what month to append 04 or 05 or 06?

Benedict

Former Member
0 Kudos

We have another column in a different projection having year and month, so we can join with it to get exchange rates

Prj1                       Prj2

20142                    201404

                             201405

                             201406

Regards,

Former Member
0 Kudos

Hello Kotha,

I am really confused as to what your desired output is, 'coz i don't understand the logic behind concatenating the "month" & "year" and joining that projection with the projection containing "Exchange rates" .

Regards,

Krishna.

former_member184768
Active Contributor
0 Kudos

Did you check M_TIME_DIMENSION. See if you can join on the quarter column and get the required months from there.

Ravi

BenedictV
Active Contributor
0 Kudos

hi Ram,

For this you will have to create three separate Calc. columns,

CC1 would be CASE('Quartercolumn',20121,2012101,20122,2012204,20123,201237,20124,2012410)

CC2 would be CASE('QuarterColumn',20121,2012102,20122,2012205 and so on

CC3 would be CASE('QuarterColumn',20121,2012103,20122,2012206.....

You will have to create three unions and in first union map CC1, in second map CC2 and in third map CC3 to the same target column.

Thanks,

Benedict

Answers (1)

Answers (1)

Former Member
0 Kudos

Appreciate all your help.

Created the join between the quarter column and month column in different tables using below logic

if(in(rightstr("0CALQUARTER", 1), '1') = 1, leftstr("0CALQUARTER",4)+'01', if(in(rightstr("0CALQUARTER", 1), '2') = 1, leftstr("0CALQUARTER",4)+'04', if(in(rightstr("0CALQUARTER", 1), '3') = 1, leftstr("0CALQUARTER",4)+'07', if(in(rightstr("0CALQUARTER", 1), '4') = 1, leftstr("0CALQUARTER",4)+'10',''))))

Former Member
0 Kudos

Hi,

This is bringing only first month of the quarter

Is there any way we can bring max month of quarter by modifying this

if(in(rightstr("0CALQUARTER", 1), '1') = 1, leftstr("0CALQUARTER",4)+'01', if(in(rightstr("0CALQUARTER", 1), '2') = 1, leftstr("0CALQUARTER",4)+'04', if(in(rightstr("0CALQUARTER", 1), '3') = 1, leftstr("0CALQUARTER",4)+'07', if(in(rightstr("0CALQUARTER", 1), '4') = 1, leftstr("0CALQUARTER",4)+'10',''))))

Quarter data would be in following manner 20141/20142/20143/20144

Month data would be in following manner 201401/201402/201403/201404 etc