Good morning,
We have a problem wanting to set a fixed time for the date parameter. We want the user to only select the day, and for the time to be fixed at 06:00:00 am. By default, Amazon Quicksight is set to 00:00:00 am.
We will then use this parameter as a filter for all visuals on the dashboard.
If we edit the parameter, we can establish that the time is displayed at 06:00:00 am, but the data is still the same as at 00:00:00 am.
Is there a way to set the time so that it is always 06:00:00 am and the user can only select the day?
Thank you so much!
Hello @agustinmoncada94!
Currently its not possible to set a fixed time in the parameter default value, but there might be a work around. Could you share an example of a value in your date field? This would help understand if anything else would need to be done to make a calculated field work.
That being said, you could try something with addDateTime or the lag function in a calculated field so that when your date field is filtered by the parameter value, the calculated field will not show anything prior to 6am.
Good afternoon,
My date field is called TimeDefaulId. I attached a photo of the table so you can see the values it takes.
My goal is that in the parameters, which I then use as a filter in all visual elements, the user can only select day, month and year (YYYY/MM/DD) and does not have the option to select the time. The time, by default, should be 06:00:00 in both parameters (start date and end date).
The problem is that, by default, quicksight sets the time to 00:00:00.
I have tried making a calculated field with that function and then using it as a filter, where I specified the start date and end date parameters, but the results of the dashboards were not correct. Do you have any recommendations on how to do this?
Hey @agustinmoncada94 !
Thank you for getting back to me with the table view, and sharing those details about the calculated field!
Could you try this calculated field:
ifelse(
{Order Date} >= ${StartDate} AND
{Order Date} <= ${EndDate} AND
truncDate('HH', {Order Date}) >= '06',
{Order Date}
)
You might have to play with the the date format for the truncDate to fit your data. Let me know if this helps!
Hello @agustinmoncada94, since we have not heard back from you, I will mark @duncan’s last response as the solution. If you have any further questions, please let us know. Thank you!
Good afternoon, I have tried making the calculated field with the function that you have indicated to me:
ifelse(
TimeDefaultId >= ${StartDate} AND
TimeDefaultId <= ${EndDate} AND
extract(“HH”, TimeDefaultId) >= 6,
TimeDefaultId,
NULL
)
This is created without problems or errors.
Likewise, how do you suggest I should use it?
I have used it as a date filter for my visual elements, where I use the StartDate and EndDate parameters in it, but the result of the visual element is not the one between 06:00 am of the day selected in the StartDate parameter and 06 :00 am of the day selected in the End Date.
I clarify that my visual element is a kpi.
The true value of the kpi is the one shown in the following image, in the selected time period (from the date StartDate 2024/03/04 06:00:00 am to the date EndDate 2024/03/05 06:00: 00am)
I clarify that in this kpi that I show in the image, the filter is the TimeDefaulId field, with the StartDate and EndDate parameters.
In this case, I manually selected the time from 06:00 am to 06:00 am. What we want to achieve is that the user does not have to select the time, but rather that by default, the visual element uses it at that time.