Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
swati_patil4
Participant

While working in calculation of dates in Webi report I came across a situation where
the "ToDate" function in Webi was not giving the result as expected. While doing some reasearch
on this understood that there was simple mistake happened and it can happen by anyone.

 

Would like to explain which is the mistake has done by general user/developer and
solution for this.

Scenario:

- One date is passed to the report as a prompt value and other date comes from the
Universe Object or query result.

1.  MeetingDate is a prompt

2. Expiry date is an Object

Need to calculate the difference between these two dates. We can use DaysBetween
function in Webi.

Error:  If I pass MeetingDate = 24th Oct 2012 (24/10/2012) while converting this string value into Date format it was

giving me the result as 24/01/2012.

Solution:

As the MeetingDate is a prompt  its data type is “String” so we need to convert this String into Date format.

For this we can use ToDate () function and we have to pass the correct format of the date.

Mistake:

- While converting the MeetingDate into date I used the following function

      • ToDate(UserResponse(“EnterMeetingDate”),”dd/mm/yyyy”)
      • In above syntax if I use “mm” and it gave me wrong result e.g. 24/01/2012

To get the correct result we have to use the correct syntax for month and it is like
“dd/MM/yyyy”

When I used ToDate(UserResponse(“EnterMeetingDate”),”dd/MM/yyyy”) I got the correct
result as 24/10/2012.

4 Comments
Labels in this area