on 2020 Feb 20 8:45 AM
Hello!
My question is very similar to this: SAC show two date periods using 1 date (story or page) filter and I was able to do so by using the date ranges filter on the restricted measures. My issue now is how would that happen if I'm gonna do it on application designer? I noticed that in the application designer, the date ranges filter is set to the current system date. My goal is to have the date be set by the user (custom input). I'm thinking of using the timerange function but I don't think that it will solve the problem.
Any help is appreciated. Thank you!
Request clarification before answering.
Hi forest_green,
I stumbled over your question. I was also searching for a date input possibility in application designer. Now I got one. It's not the fanciest but maybe it helps you too.
I created two Input Fields for the start and the end of the time range and a button for the execution.

Code of Button "Set period":
var date_start = InputField_start.getValue();
var date_end = InputField_end.getValue();
var day_start = ConvertUtils.stringToInteger(date_start.substring(0,3));
var day_end = ConvertUtils.stringToInteger(date_end.substring(0,3));
var month_start = ConvertUtils.stringToInteger(date_start.substring(3,6));
var month_end = ConvertUtils.stringToInteger(date_end.substring(3,6));
//in javascript month starts with 0 not 1, so you have to do -1
var month_start_conv = month_start-1;
var month_end_conv = month_end-1;
var year_start = ConvertUtils.stringToInteger(date_start.substring(6,10));
var year_end = ConvertUtils.stringToInteger(date_end.substring(6,10));
var range = TimeRange.create(TimeRangeGranularity.Day, new Date(year_start,month_start_conv,day_start),new Date(year_end,month_end_conv,day_end));
console.log(range);
Chart_1.getDataSource().setDimensionFilter("0CALDAY",range);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
I too stumbled across this thread! I've had a similar requirement in the past which has presented once again this week. I've created the following simple example via a button onSelect -

Once I run, as per previous attempts, it errors as follows -

Have you experienced anything similar or have any insights?
Thanks
Patrick
Hi patrick99
I am not sure I need to see more details. Could you provide more error details from {type: and from {action: maybe. I need to see which values he couldnt fetch. But first you have to check if the Dimension 2CLX..is able to handle timeranges. In other words if the Dimension has a Dynamic Date Calculation.

BR Alex
| User | Count |
|---|---|
| 18 | |
| 8 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.