cancel
Showing results for 
Search instead for 
Did you mean: 

Using DateDifference in Calculated Column in Attribute Views

Former Member
0 Kudos

Hi all,

I have created a calculated column in Attribute view wherein I am using DateDifference function

My structure is as follows -

As seen I am getting 1 day less than what is required whereas if start_dt and end _dt is same I am getting correct value

I am using the formula in my calculated column -

daysbetween(date(start_dt),date(end_dt))

Also If I am firing a direct query in SQL editor in HANA I am getting correct values.

select days_between(to_date(start_dt), to_date(end_dt)) from table_name

Kindly tell what is getting wrong above.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185165
Active Participant
0 Kudos

Hi Nakul,

Please try the following and see.

daysbetween(date(start_dt),date(end_dt)+1)


Regards,

Vijay

rindia
Active Contributor
0 Kudos

Hi Nakul,

I tried the same and getting correct values:

daysbetween(date(start_dt),date(end_dt))

I am on revision 63. I guess the revision should not be any problem. Just check closely your calculated column data type is Integer and column type is measure.
   

Regards

Raj

Former Member
0 Kudos

Hi Raj,

Can you please in which view you have created the above calculated column - attribute, analytical or calculation view?

rindia
Active Contributor
0 Kudos

I prepared calculated column in Analytic view.