Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
How to find last 5 days depending selection.
For Ex: I have below data.
Tr_Date | Sales |
01-05-2015 | 10 |
02-05-2015 | 23 |
03-05-2015 | 34 |
04-05-2015 | 55 |
05-05-2015 | 12 |
06-05-2015 | 11 |
07-05-2015 | 22 |
08-05-2015 | 33 |
09-05-2015 | 45 |
Filter is Tr_ Date
Straight table: Dim - Tr_Date, Expression - ?
so If I select Tr_Date-6th then I need 2 to 6 sales.
Created a variable vVar = ='>=' & Date(Max(Tr_Date) - 4, 'DD-MM-YYYY') & '<=' & Date(Max(Tr_Date), 'DD-MM-YYYY')
and use this as your expression: =Sum({<Tr_Date = {'$(vVar)'}>}Sales)
Also find attached the application.
Best,
Sunny
Use this in your set analysis:
{<Tr_Date = {">= $(=Date(Max(Tr_Date) - 4, 'DD-MM-YYYY')) <= $(=Date(Max(Tr_Date), 'DD-MM-YYYY'))"}>}
I think -4 should work to reach 2nd May, but if not try it with -5.
Best,
Sunny
Hi priya,
pls try the below expression if it works fine then give me correct answer
=sum({<Tr_Date={">=$(=max(Tr_Date))<=$(=max(Tr_Date)+4)"}>}Sales)
Regards,
prabhas
Hi Prabhas,
Its not working I am attaching my app
Hi SunIndia,
Its not working I am attaching my app
Created a variable vVar = ='>=' & Date(Max(Tr_Date) - 4, 'DD-MM-YYYY') & '<=' & Date(Max(Tr_Date), 'DD-MM-YYYY')
and use this as your expression: =Sum({<Tr_Date = {'$(vVar)'}>}Sales)
Also find attached the application.
Best,
Sunny
A tweaking of SunIndia's suggestion should work for you:
Sum( {<Tr_Date = {"<=$(=Date(Num(Max(Tr_Date))))>$(=Date(Max(Tr_Date)-4)))"}>} Sales)
Leaving out the formatting parameter for the Date() function will default to the formatting of dates that is currently active for your settings on your computer.
please attach your application then it will very clear
I was having a hard time understanding why the formula wasn't working. Petter Skjolden do you know why the date formatting was creating a problem??
Best,
Sunny
Sum( {$ <Tr_Date = {">=$(=Date(Max(Tr_Date)-4))<=$(=Date(Max(Tr_Date)))"}>} Sales)