Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Current Date minus2 question

Former Member
0 Likes
2,197
  • SAP Managed Tags

I am trying to create a dimension in IDT 4.2 that would show me the current date minus 2

I tried using this RelativeDate(CurrentDate();-2) ,however when i use this dimension in a filter when i run the query in webi it doesn't work.

Someone had sent me a code that pulls the first day of the month which works toDate(left(toString(curDate()),8)+'01')

Can i modify this one to pull current day minus 2? What would that syntax be?

7 REPLIES 7
Read only

venkateswaran_k
Active Contributor
0 Likes
2,097
  • SAP Managed Tags

Hi

Try as below

1. Where(Date = Relativedate(currentdate();-2))

or

1. Create a variable lv_day  = If([yourdate] <= RelativeDate(Currentdate();-2);1;0)
2. Filter your report by [lv_day] = 1

Regards,

Venkat

Read only

0 Likes
2,097
  • SAP Managed Tags

When I use option 1, i still get an error.

Read only

0 Likes
2,097
  • SAP Managed Tags

I tried adding this on IDT and didnt work.

Read only

venkateswaran_k
Active Contributor
0 Likes
2,097
  • SAP Managed Tags

Hi

Is your problem resolved?

Read only

venkateswaran_k
Active Contributor
0 Likes
2,097
  • SAP Managed Tags

Dear Ian

Kindly update if your problem is resolved and update with the solution and mark the answer you accepted.

This will help others to get solution if they get similar issue.

Regards,

Venkat

Read only

Former Member
0 Likes
2,097
  • SAP Managed Tags

When I enter it here..I still get an error message

Read only

0 Likes
2,097
  • SAP Managed Tags

You should put this condition in Where Box - not in select Box,