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.
There are different parameter types that we can use to do this. I decided to use following "Derived from table" type as shown below:
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.
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.
Hi ,
ReplyDeleteWhen 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?
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
ReplyDeleteHi,
ReplyDeleteI 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().