on 12-23-2014 12:02 AM
Hi HANA experts,
My scenario is as follows:
Currently, I have a calculated column with the following logic:
IF ( now() > daydate(string(component(now(),1))+'1010'), daydate(string(component(now(),1))+'1010'),
IF ( now() > daydate(string(component(now(),1))+'0710'), daydate(string(component(now(),1))+'0710'),
IF ( now() > daydate(string(component(now(),1))+'0410'), daydate(string(component(now(),1))+'0410'),
IF ( now() > daydate(string(component(now(),1))+'0110'), daydate(string(component(now(),1))+'0110'),
daydate(string(component(now(),1)-1)+'1010') ) ) ) )
I want to create a scripted calc view with the same such logic in a column.
What is the proper syntax to do so?
I have already tried using case statements and if statements using common sql syntax but can't seem to get it to work
Thanks in advance!
John
Hi John,
Can you try the syntax like this inside the scripted calculation view:
Note: We have to use CASE..THEN.. END instead of IF
Example below:
SELECT CASE WHEN month(now()) = '12'
THEN 'DEC'
WHEN month(now()) = '11'
Then 'NOV'
ELSE
'Other'
END as V_monthname -- result variable
from DUMMY;
Let me know if you have see any concerns.
best regards,
Varma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you please share your code?
BR
Sumeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.