on 10-13-2014 1:58 PM
Hi Experts,
We have a Analytic View on top of MHND table in HANA.
I am trying to implement Restriction on the Analytic View based on Run Date (LAUFD) so that we get only last 45 Days.
We want to keep the restriction as dynamic (based on current date) and tried to implement it as LAUFD >= (Current_Date - 45).
I tried to create a Variable on Run Date but could not successfully implement it.
Thanks,
Krishnendu Roy.
Try using ADDDAYS function yet use a negative number in the expression of your variable;
something like this;
adddays(date(now()), -45)
-Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernando, he didn't mention his client requirement so I'm not sure the answer to that. I just know I have it working successfully when previewing within Studio using this ADDDAYS method with variable. But I would think the same expression would also work via the input parameter as you suggest depending upon their need.
-Patrick
Hi Patrick,
The Studio preview is one of that "special clients" that read the metadata and process constant/expressions if you go through hdbsql directly he will not give hint or calculate an expression for you.
After DP execution click on log and see that SQL generated have what you informed by you on where clause.
Regards, Fernando Da Rós
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.