Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic dates in Chart

Hi,

I have a chart that shows instances calculated on dates. It calculates a lead time based on when a post is received (see formula below)

=class(today()-received_date, vBand)

now i want to restrict the chart to only show the dates with a lead time of MAX 200 days. I cannot set the x-axis to a max since i am going to need to be able to at occasion show the values that are greater than 200.

My suggestion would be to make an automatic selection (trigger) based on my table received_date and then select all TODAY()-200, but I cannot get this function to work. Help?

Cheers,

1 Solution

Accepted Solutions
Nicole-Smith

You are correct--it will select the largest 200 dates.  So, for example, if I had every date from January 1, 2013 to today (December 3, 2013) in my date field, it would select everything from May 18, 2013 up to and including today (200 dates in all).

View solution in original post

9 Replies
Anonymous
Not applicable
Author

Hi,

try edit the dimension received_date and you write

= aggr(Date(MaxString({$<received_date = {'>=$(=(today() - 200))'}>}received_date ),'DD-MM-YYYY'),received_date )

Not applicable
Author

sorry, cant get that to work . heres the sample btw

Anonymous
Not applicable
Author

See it

Not applicable
Author

actually this will not fly since it will not let me change the values in the graph in case i want to see something outside the interval. i would much rather we solved the problem by auto-selecting the dates from the table.

Not applicable
Author

i have made some updates to this, but i still havent solved the original issue. I would still like to have the graph automatically select the first 200 dates from the received table when opened; the formula im looking for would be something like select(Today()-200) but I am not good enough at qlikview to make that formula happen. i cannot have the selection static though since i will need to be able to change it if needed.

Nicole-Smith

Document Properties > Triggers > On Open

Select in Field: received_date

Search String:  ='>='&max(received_date,200)

**EDIT:  Example.qvw is attached.

Not applicable
Author

thank you nicole!

i just have a follow up question: if understand your formula correctly this will select the first (largest) 200 values in the received_date table, not the values where today()-received_date <= 200?

the formula you presented works fine, i just want to know in order to understand better .

Nicole-Smith

You are correct--it will select the largest 200 dates.  So, for example, if I had every date from January 1, 2013 to today (December 3, 2013) in my date field, it would select everything from May 18, 2013 up to and including today (200 dates in all).

Not applicable
Author

excellent - great!