cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Calculation View temporal Join

D039507
Advisor
Advisor
0 Kudos

Hi all,

I have a question: I want to join to tables in a graphical calculation View to get FIELD1 in TAB1:

Like this:

if tab2-weekday = tab1-weekday

and tab2-time_from GE tab1-time

and tab2-time_to LE tab1-time

-> GET FIELD1

Has anyone an idea, how I can do this with a graphical calculation view?

Best Regards

Thorsten

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Thorsten,

I had the same issue. I think this can only work for analytical view.

Did you found any alternate approach ?

Regards,

Suman

D039507
Advisor
Advisor
0 Kudos

Hi Suman,

no alternate approach. You are right, it is only possible in an analytic view. I have done this with a scripted view...

Best Regards

Thorsten

lbreddemann
Active Contributor
0 Kudos

Yes you can do this in a graphical calc view and it's not that difficult either.

While the temporal join feature is not yet available in calc views (SPS11) as a specific function, you can do the very same what you would do with SQL:


select tab1.WEEKDAY, tab1."TIME", tab2.FIELD1

from tab1 inner join tab2

     on  tab1.weekday = tab2.weekday

where tab1.time between tab2.time_from

                       and tab2.time_to;

So, all you need is a equal inner join on the WEEKDAY column and a projection on top of that with a filter condition:


"TIME">="TIME_FROM" and "TIME"<="TIME_TO"

And that's already it.

Former Member
0 Kudos

Thank you , That works !

D039507
Advisor
Advisor
0 Kudos

Yes, it works. But you only have a problem if you have a time table like this:

lbreddemann
Active Contributor
0 Kudos

Correct, but this would also not work with the temporal join in the analytical view or the ABAP statement you posted initially.

For the case that the 24:00 o'clock mark gets passed a special case handling needs to be established.

Depending on the requirements this could be done in different ways - which would still be possible in graphical calc. views.

former_member185132
Active Contributor
0 Kudos

I believe this blog explains what you are looking for: http://scn.sap.com/community/hana-in-memory/blog/2014/09/28/using-temporal-join-to-fetch-the-result-...

It is not for a Calc View, but you can try to do it in an Analytical view and use the AN view within the CV