Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a Datefield called Date_D, Now I want a bar chart for sales, where my X axis will have 5 latest dates...Please note, the most recent date could be any date (it may be Yesterday date or any other date)...and something like Today()-5 wont work in my case as no regular interval is there..
Thanks in Advance !!!
Sid
Hi,
Simply add a set analysis in your expression like below:
sum({<Date_D={">=$(=Max(Date_D)-4)"}>}sales)
HTH
Thanks Sushil,
I am ok with Max(Date_D but then '-4' will be not a dynamic expression as I am not sure that last 4 dates will fall in Max(Date_D)_-4 Range.
for example: if My max date is say 8th July 2016 then expression will give me dates from 4th July to 8th July.
I want last 4 dates available in my column. they could be say 8thjuly2016, 6th July2016,5th July 20162nd July2016.
Regards
Sid
I would further suggest adding a date function to this:
Sum({<Date_D={">=$(=Date(Max(Date_D)-4, 'DateFieldFormatHere'))"}>}sales)
Hi Sunny, Thanks for your suggestion. Please let me again reframe my query, Its NOT the last consecutive 4 days but I guess what I want is top 5 dates (they may not be Consecutive).
Please suggest some solution to this problem.
Regards
Sid
Try this then...
Sum({<Date_D={">=$(=Date(Max(Date_D, 5), 'DateFieldFormatHere'))"}>}sales)
Here Max(Date_D, 5) will give you your 5th largest available date and all the dates above that date
or this if you always want to see top 5 dates regardless of any selection
Sum({<Date_D={">=$(=Date(Max({1}Date_D, 5), 'DateFieldFormatHere'))"}>}sales)
Now I realize how help this expression is , you have answered my next problem in advance !!! ..Expression that populate value rerardless any selection is what I was abut to seek...
Many Thanks Sunny !!!