Hi Malik,
Thank you for your response.
I tried the above formula. But it still gives the same results. I already have a variable editor in the report Current date-33 to current date which I edited and used the formula you suggested but then the date range shows up in the format as 5/30/2013 to 7/2/2013:2.51. I am not sure what this 2.51 is?
And it is not giving the results as expected.
Requirement is like user wants to see the results as per the date range current date-33 to current date(which I made a variable editor in the report),again the user wants to see the last price(i.e sales amount/quantity,which I calculated in the report) for the product for the highest date.
For example:when I select(prompts) category- A,site- X, product -1 and run the query,it gives me the average of the last price between the date range current date-33 to current date. Instead I want that between the date range it selects the latest value and gives the last price i.e if it doesnt have data for 2nd july,it looks to july 1st then looks at june 30th and gives the price. For product 1 in the report it shows last price as 0.23, but I want to see last price as 1.67 for date 6/30/2013 then 1.46 for date 6/26/2013 and so on until current date-33.
Hope I am clear in explaining my requirement.
Thanks,
Nisha