Skip to Content
author's profile photo Former Member
Former Member

Moving Average Calculation in HANA.

Hi,

I have a requirement where I need to calculate the moving average.

I got to know about certain Business Function Libraries(BFL) whiich has libraries defined

for moving average calculation.

However,its not clear how should we go about implementing the functions and use it in the code.

It would be really helpful if anyone of the experts around here can give certain illustrations or

guidance in using these function.

Thanks and Regards,

Manisha.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 06, 2014 at 09:44 PM

    Hi,

    It's on page 92 of http://help.sap.com/hana/SAP_HANA_Business_Function_Library_BFL_en.pdf. If you want to use those functions in a local table in a SQLScript Procedure or Scripted Calc View then you can do so, just replace the output table with a local table in SQLScript.

    CALL _SYS_AFL.AFLBFL_MOVINGAVERAGEANDSUM_PROC(BFL_MAMS_ORIGINAL_TBL, BFL_MAMS_AVERAGESTYLE_TBL, BFL_MAMS_AVERAGEMETHOD_TBL, BFL_MAMS_PRIME_TBL, BFL_MAMS_AVERAGEPERIODS_TBL, BFL_MAMS_WEIGHTINGS_TBL, :lt_results);

    You can create the tabletypes and weighting tables in advance, or you can do the weightings dynamically using local input variables and arrays.

    If you're still stuck, paste your DDL, Data and Code and someone will help you out.

    John

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.