Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Custom Date Range to display in Bar Chart

Hello All,

Fairly new to this awesome tool and community.

My data spans 20 years and for a particular chart I would like to only display data for 2016-2019.

My expression is a simple count.

What is the best approach to do this?

As a side, I did manage to create a list box and limiting it to 2016-2019, however, dont know the optimal method to limit the data range in the chart.

Any help much appreciated.

Best.
Sarosh

4 Replies
Gysbert_Wassenaar

As a side, I did manage to create a list box and limiting it to 2016-2019, however, dont know the optimal method to limit the data range in the chart.

That's a very good way to do it. It leaves the user free to change the range if necessary. 

You can also limit the range in the expressions. Suppose you have a Year field and an expression sum(Forecast). To limit that expression to 2016-2019 you'd change it to sum({<Year={2016,2017,2018,2019}>}Forecast) or to sum({<Year={'>=2016<=2019'}>}Forecast).

Yet another way is to create a bookmark for that selection and then use the bookmark (for example a bookmark with ID BM04) in the expression: sum({BM04}Forecast).

And if you really only need that range and won't use data from the other years in your document at all, then don't load the data from those years. Load only the data you need in the script and filter out the other data with a WHERE clause in the load statement:

MyTable:
LOAD * FROM MySource WHERE Year >= 2016 and Year <=2019;


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you so much for the detailed response.

sreeni_qvd
Creator
Creator

Hi ,

Please see the below chart expression. using YEAR dimension.

Capture.PNG

Not applicable
Author

Thank you Sreeni! The visual was great.