dynamic prompt based on date
We have a filter that is used on most all of our dashboards & reports. "Year - Month". Examples:
2019 - Jul
2018 - May
We do not want to use 2 prompts to accomplish this.
I need a way to dynamically assign the default value to each report's prompt based on the result of a query, specifically:
select fp_yr_mth_nm
from d_fp
where 1=1
and d_fp_ky = (select max(d_fp_ky) from d_fp where fp_validn_flg = 'Y');
I still need a list of all of the available YEAR - MONTH values in the prompt (sorted appropriately), but I need the one returned by the above SQL to be the default.
In our old reporting tool, we had a dynamic variable that stored the result of that SQL, it executed every 10 minutes to see if the value changed. Then on all reports/dashboards, the result of that variable's query was assigned to the default value of each report.
How can I accomplish this same end-result? I'm thinking something along the lines of using freehand SQL to generate my list of prompt values, and then using some form of MAX value somewhere to select the proper value from my list, but I have no idea how to accomplish this in YF.
Hi Bryan,
Thanks for reaching out. You can use a 'max' as a default value when it's detected as a metric or date, but the problem is he needs a column that has both the month - year.
So assuming you already have a date column (which I assume you do), you can use the 'month start date' date function at the view level, which will convert the data to month/year (in numeric format), then just change the format to display it in text, and cache it at the report level:
Please let me know if you have any questions on this.
Regards, Mike
Hi Bryan,
Thanks for reaching out. You can use a 'max' as a default value when it's detected as a metric or date, but the problem is he needs a column that has both the month - year.
So assuming you already have a date column (which I assume you do), you can use the 'month start date' date function at the view level, which will convert the data to month/year (in numeric format), then just change the format to display it in text, and cache it at the report level:
Please let me know if you have any questions on this.
Regards, Mike
Hi Bryan,
I just wanted to check in and see how things are going with this.
Regards,
Mike
Hi Bryan,
I just wanted to check in and see how things are going with this.
Regards,
Mike
Hi Bryan,
Just wanted to let you know I've notified Nathan of this issue, and he will be reaching out in regards to this. Please let me know how it goes.
Thanks,
Eric
Hi Bryan,
Just wanted to let you know I've notified Nathan of this issue, and he will be reaching out in regards to this. Please let me know how it goes.
Thanks,
Eric
Hi Bryan,
Just wanted to confirm you've gotten assistance with this?
Thanks,
Eric
Hi Bryan,
Just wanted to confirm you've gotten assistance with this?
Thanks,
Eric
I had a call with Nathan, this has an idea that is in development right now. This can be closed. Thanks!
I had a call with Nathan, this has an idea that is in development right now. This can be closed. Thanks!
Thanks for the update, Bryan. I will mark this as Answered.
Thanks,
Eric
Thanks for the update, Bryan. I will mark this as Answered.
Thanks,
Eric
Replies have been locked on this page!