Skip to Content
avatar image
Former Member

Dynamic input parameters

I have a calculation view that has two input parameters: from_date and to_date. These parameters are eventually mapped down to an attribute view.  Is there a way to dynamically change the value of the parameter?  For example, if the user enters 201510 in the to_date, I want HANA to subtract 100 from the value and use the value 201410 instead. 

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 23, 2015 at 05:23 PM

    Hi,

    Sure. You can do that on the Expression Editor on the Projection holding your Attribute View in the Calculation View. Expression would be something like: COLUMN = '$$TO_DATE$$'-100.

    BRs,

    Lucas de Oliveira

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 26, 2015 at 07:12 AM

    Hi Shadi,

    You can do any kind of operation on the input parameter of date type.

    Consider this as example, which would be of help to you.

    How to get abap date in HANA calculated column and calculate date difference

    Thanks & Regards,
    Vijay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2015 at 03:28 PM

    I know I can apply a filter in the projection node but that means the projection node will bring back ALL the data then apply the filter.  What I would like is to use a calculated column in the attribute view that takes in the input parameter from the calculation view.  For example, the input parameter in the CV is ip_yyyymm_from.  CA_PRIOR_YR_IP uses an input parameter coming from the calculation view.  I can use the IP directly in a filter but I can't seem to use a calculated column.

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Shad,

      Well you didn't mention you're doing that on top of calculated columns. That is not so good idea indeed and that will work for filter/where clauses/joins on calculated columns. So why would you want to apply that on a calculated column?

      You can apply to your concrete columns or add a new column to your base tables containing the logic you need and then filter the new column.

      BRs,

      Lucas de Oliveira