Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Not applicable

Re: Display future dates in chart

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

Highlighted

Re: Display future dates in chart

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

Highlighted

Re: Display future dates in chart

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?

Highlighted
Master III
Master III

Re: Display future dates in chart

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

Highlighted

Re: Display future dates in chart

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

Highlighted
Partner
Partner

Re: Display future dates in chart

Hi Soumya,

It might be work for your future date.

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

Highlighted
Master III
Master III

Re: Display future dates in chart

oh ok, thanks for pointing it out.

Highlighted
Not applicable

Re: Display future dates in chart

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

Highlighted

Re: Display future dates in chart

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