Sie sind auf Seite 1von 5

9/4/2014 Implementation of WTD, MTD, YTD in HANA using I...

| SCN
Getting Started New sletters Store

Hi, Moham m ed Log Out 1 points Search the Community

Products Services & Support About SCN Downloads 1


Activity Communications Actions
Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation Brow se Create

Implementation of WTD, MTD, YTD in HANA Version 1

using Input Parameters Derived from Table


created by Ravindra Channe on Oct 7, 2013 9:15 PM, last modified by Ravindra Channe on Oct 7, 2013 10:21 PM

Share 0 Tw eet 1
Like 0

Usual disclaimer:

Please note that the following model has been implemented in SPS06 (revision 60 and onwards). I am not sure
about the feasibility of this approach on the earlier revisions. The observations on the below model are based on
my personal experience and opinion.

As mentioned in the earlier blog Implementation of WTD, MTD, YTD in HANA using Script based Calc View calling
Graphical Calc view, let’s look into an option to populate the Input parameters for the Graphical Calc view using the
enhanced functionality of Input Parameters.

Rules of the game remain same i.e. same business requirements, assumptions, Sample data and Projections with
Constant columns for Pruning, as mentioned in the earlier blogs:

Implementation of WTD, MTD, YTD in HANA using Input Parameters only,

Implementation of WTD, MTD, YTD Period Reporting in HANA using Calculated Columns in Projection

This approach outlines the functionality of Derived From Table property of Input parameters. With this functionality the
Your
SELECT FROM logic in Scripted Calculation view can be replaced eliminating the need to create Scripted Calc view
for data derivation required for the Input Parameter value ranges.

The View model can be defined as follows:

The key features of the model are as follows:

Graphical Calc View, providing query column pruning (as compared to the Scripted Calc view)
Projections with Constant columns for effective query pruning for performance
Input Parameters for Filter pushdown
Derived Input parameters to implement data derivation logic

To implement the data derivation logic, you may have to use the mapping table which contains the required data
already mapped and persisted in the system. The derivation is based on the data of this table. The Derived Input
Parameter would provide the logic similar to:

SELECT mapping_value FROM mapping_table

http://scn.sap.com/docs/DOC-47277 1/5
9/4/2014 Implementation of WTD, MTD, YTD in HANA using I... | SCN
WHERE lookup_value = user_input_value;

In the case to derive the data range for WTD, MTD and YTD, a mapping table is defined which contains the Week Start
Date, Month Start Date and Year Start date mapped to each of the Calendar Day. The Input parameter with Derived
from Table performs lookup on this mapping table to derive the required dates for the date ranges.

The mapping table can be defined as follows:

The mapping table has mapping for each of the date with the required Start dates for Week, Month and Year.

The input parameters can be defined as follows:

The input parameter can be used in the Projection filter as specified below:

http://scn.sap.com/docs/DOC-47277 2/5
9/4/2014 Implementation of WTD, MTD, YTD in HANA using I... | SCN

The query on the model can be executed without impacting the performance.

The execution plan shows that the filter has been pushed down and the projection filter has been implemented.

In my personal opinion, this approach is most recommended. It provides all the positive features of Graphical
Calc views like:
Ease of development using Graphical option
Projection pruning with Constant columns
Filter Pushdown with Input Parameters
Derivation logic in the Input Parameters

The mapping table to derive the data is mostly available in the application model. In case, the derivation logic is
complicated, then it may require to simplify the logic and persist the data in the system.

As always, please feel free to comment on the document.

Thanks for your time and encouragement so far...

1383 View s
Topics: performance, in-memory_business_data_management Tags: hana, modeling, projection, calc_view , filter_pushdow n

Average User Rating My Rating:

http://scn.sap.com/docs/DOC-47277 3/5
9/4/2014 Implementation of WTD, MTD, YTD in HANA using I... | SCN
(2 ratings)

Share 0 Tw eet 1 Like 0

10 Comments

Jomy Joy Oct 8, 2013 5:28 AM

Hi Ravi,
First of all thanks !!!
I believe this mapping table is filled via a procedure based on as current date, right ?
I didn't get your point when you mentioned The mapping table to derive the data is mostly
available in the application model.

Thanks & regards,


Jomy

Like
(0)

Ravindra Channe Oct 8, 2013 7:04 AM (in response to Jomy Joy)

Hi Jomy,

What I meant was, mostly you don't need to create the table specially for this purpose. In my
case, such mapping table was already available for some of the lookups required in the
transaction data flow.

But in case, even if you need to create a new table, it is still worth creating as it may be one
time effort. Or as you mentioned, it can be populated using a procedure as and when the
mapping data changes.

Regards,

Ravi

Like
(0)

Vivek Singh Bhoj Oct 8, 2013 6:34 AM

Good blog Ravi!


This will be very helpful.
In addition to the Implementation of WTD, MTD, YTD in HANA, this blog also provides a good
approach for improving performance of HANA Model
Thanks for sharing

Regards,
Vivek
Like
(0)

Ravindra Channe Oct 8, 2013 7:05 AM (in response to Vivek Singh Bhoj)

Thanks Vivek. .

I try to write the blogs as informative as yours. Thanks for the inspiration.

Regards,

Ravi
Like
(1)

Vivek Singh Bhoj Oct 8, 2013 7:27 AM (in response to Ravindra Channe)

Thanks Ravi

I have learned a lot from you through your discussions.


I would say you,Lars and Thomas are pillars of HANA at SCN as you all are
always ready to help everyone at SCN by taking time out of your busy schedules.

Regards,
Vivek
Like
(0)

Rama Shankar Oct 8, 2013 3:27 PM

Great Job Ravi - Thanks !

http://scn.sap.com/docs/DOC-47277 4/5
9/4/2014 Implementation of WTD, MTD, YTD in HANA using I... | SCN

Like
(0)

Raj Kumar Salla Oct 15, 2013 9:42 AM

Hi Ravi,

When I seen the title of this document, I thought someone replied to your old document but today I
realized when I opened this. Input parameters derived from table is something new to me. Really a
good one. Keep up the good work.

Regards
Raj
Like
(0)

Patrick Matambanadzo Oct 25, 2013 10:36 AM

Hi Ravi

Excellent blog thanks.

Regards
Pat
Like
(0)

Su Srikanth Jul 18, 2014 8:05 AM

Hi Ravi,

So is it the case that only the first row value of the table is picked up in the input parameter? Meaning,
if i want to see the entire list of values from the table in the input parameters, how can it be achieved?

Await for reply, thanks!


Su
Like
(0)

HANA HANA Aug 15, 2014 11:54 AM

Hi Ravi,

Thanks for sharing. Veru useful.

Is there any Procedure to be run on periodic basis for populating the mapping table . Can you please
share that as well.

Thanks

Like
(0)

Site Index Contact Us SAP Help Portal


Follow SCN
Privacy Terms of Use Legal Disclosure Copyright

http://scn.sap.com/docs/DOC-47277 5/5