Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

9 Replies
Not applicable
Author

Just to add to the previous post- The expression is to be added in the dimension section of a bar chart.

sunny_talwar

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

sunny_talwar

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

Get the Dates Right

Why don’t my dates work?

Digvijay_Singh

Ensure that date formats are compatible on both side of the operator.

sunny_talwar

AFAIK, If statement do not require you to have same formats. Its only an issue when using set analysis

susovan
Partner - Specialist
Partner - Specialist

Hi Soumya,

It might be work for your future date.

Date(Today()+1,'DD/MM/YYYY')

Warm Regards,
Susovan
Digvijay_Singh

oh ok, thanks for pointing it out.

Not applicable
Author

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))

sunny_talwar

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