
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Display future dates in chart
Hi,
I need to create a chart where data is displayed only for future dates
i.e. Dates> today()
How do I write an expression to achieve this?
I tried something like Date > Date(today(),'YYYY-MM-DD')
This did not work.
Please suggest a solution
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to add to the previous post- The expression is to be added in the dimension section of a bar chart.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be like this in your calculated dimension:
If(Dates >Today(), Dates)
Make sure to check 'Suppress When Value Is Null' on the dimension tab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another thing to note here is that your Dates field need to be read as dual in order for this to work. Use Date#() in the script to make sure Dates are read as dual if they are not. Check the following links for more help on this topic

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ensure that date formats are compatible on both side of the operator.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AFAIK, If statement do not require you to have same formats. Its only an issue when using set analysis


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Soumya,
It might be work for your future date.
Date(Today()+1,'DD/MM/YYYY')
Susovan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
oh ok, thanks for pointing it out.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the replies.
I applied a condition as (given below) on the measure and the chart now displays values only for future dates
=Sum( If ( DATE>Date(today(),'YYYY-MM-DD') , Sales))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can replicate this using set analysis as well:
=Sum({<DATE *= {"=$(='>' & Date(Today(),'YYYY-MM-DD'))"}>} Sales)
To filter based on selection in DATE selected
or
=Sum({<DATE = {"=$(='>' & Date(Today(),'YYYY-MM-DD'))"}>} Sales)
To always display future dates based on selection in DATE field
