Ever set a Filter to Current time frame but the data is not always there yet?
Time card data is a good example, it has to be approved then processed and sometimes that gets done in two day some time 4 days.
Do not set it back far enough so there always data or make the user go back if there is no data, use a script in no data.
// Get the parent view.
var parentView = this.parentView;
// Get the view parameters.
var viewParameters = parentView.control.viewParameters;
// Using the library, get the view parameter based on it’s name
var viewParameter = this.parentView.control.getViewParameterByName(“viewParameter”);
//Go back one time period on offset
viewParameter.parameterValue.token.offset = viewParameter.parameterValue.token.offset -1;
viewParameter.invalidateParameterValueLastModifiedTime();
viewParameter.refreshAllAdapters();
Simple but very effective.
This can go wrong if the user tries to view a period of time before your data starts, it will take over and just keep going back. Have the user clear personalization or you could disable it for the page (but that for the entire page, works if everything on the page has this script on it).