SAP HANA Input Parameter - Derived from Table - Use Expression in Filter Value

Recently, I have experienced something while modeling HANA information view that I want to share with everyone. 


Case: 

Dynamic Filter for projection with current Fiscal Year and Fiscal Period. 


Method:

There are different parameter types that we can use to do this. I decided to use following "Derived from table" type as shown below: 



Challenge:

When filtering column then it displays list of values from the same HANA information view and we can select the date. Now, as the requirement is current Fiscal Year and Period so how do we filter the column to dynamically select current date in "Filter Value" section?

Solution:

Like everyone, I expected it to understand the expression. So I tried following and it worked. I used the expression 

currentdate()



I was aware that I could use expression in the "Default Value" section (as explained in SAP HANA Developer Guide) but didn't expect it to work in "Filter Value". I was able to filter the projection using this input parameter. To test the filtering, I removed the input parameter and the projection displayed all the years rather than just current year. Hopefully, when I get an explanation for this then I will share it here. For now, you can try different expressions.


Comments

  1. Hi ,

    When I am trying to get the date information dynamically using currentdate() function, I am getting below error:

    SAP DBTech JDBC: [339]: invalid number: [6930] exception 6930:
    AttributeEngine/InternalTable.cpp:7056
    attribute value is not a number; $function$=createExpressionColumnEx; $message$=unable to create const column from 'int('')': attribute value is not a number(6930)

    Did it work for you?? What is the version of HANA you are using?

    ReplyDelete
  2. Eagerly waiting for Windows 10 to upgrade my PC.. But nothing was happening. I noticed this error in the Event Viewer System Log:essay checker

    ReplyDelete
  3. Hi,

    I want to put the similar restriction for the UTC converted current date(using UTCTOLOCAL() function), I'm getting error when I use this function with now() or currentdate().

    ReplyDelete

Post a Comment

Popular posts from this blog

SLT Replication Issue Due To Timeout Reading Logging Tables

SAP HANA Content Security Roles Setup