In an analysis, I can change the group by among different time type, but once it is made to dashboard, these options are no longer there. Is there a way to make that option still available in the dashboard or there is a different way for this? Thanks
Hi,
yes, that is possible.
- Create an single value parameter
- Create a Dropdown control from this parameter and manually write the list of values one can choose in this control
- Create calculated fields for each option with truncDate
- Create a calculated field
ifelse(PARAMETER=‘year’,year_axis,
ifelse(PARAMETER=month’, month_axis,… - Use this calculated field as your x-axis
- You can move the control down to you visual
This way the user can change the x axis to different aggregationlevels.
Thanks for the pointer. This looks like a good solution.
Hi, I tried to follow your steps, but there must be something I don’t fully understand and it is not working at the moment. Can you take a look and see what I am missing:
- Created a single value parameter called XAxis (Data Type=String, Value = Single Value, Static default = Month)
- Did Add control with XAxis (Name=X-Axis,Style=Dropdown,Value=Specific values of Day/Week/Month, and Hide Select all option)
- Created these calculated fields with trucDate (date is my date column):
Day: truncDate(‘DD’,date)
Week: truncDate(‘WK’,date)
Month: truncDate(‘MM’,date) - Created a calculated field XScale as following:
ifelse(${XAxis}=‘Day’,{Day},${XAxis}=‘Week’,{Week},${XAxis}=‘Month’,{Month},{Day}) - Use XScale as my x-axis for the visual
- I am not sure which “control” you are referring here. I assume it is XAxis that is already covered in Step 2. But it does not work. Nothing changed when I change the dropdown option. Could you clarify a little more?
Thanks for your help.
Hi,
there is only one difference to my calculated field. I have NULL as the else-value
ifelse(${XAxis}=‘Day’,{Day}
,${XAxis}=‘Week’,{Week}
,${XAxis}=‘Month’,{Month},NULL)
I did everything else the same way. The values in the control are case sensitive, you can check this.
Can you create a table with XScale as the only column and then change the selection in the control? It is easier to see the changes in a table.
Hi thomask,
There is something strange. I initially applied the procedure on my private data, I can see XScale was changing, but not the plot scale. So I was thinking let me use a public set of data so I can show you. However, the solution is working on the public set of data. So there must be something I did on my private data that prevented it from working. I will have to figure that out.
Clearly, your solution works. Thank you very much.