How to change week date filter to display differently?
When a person chooses a week date filter in Sisense, it is displayed as 33 2023, 23 1998, 02 2008, etc. This is a confusing way to display a filter for a specific week in Sisense. Is there an edit script or other option to display the weeks as:
"09/01-09/07 2024"
"07/08 - 07/14 2005"
etc.
DRay Anonymous rapidbisupport
Rafael Ferreira
Posted 1 year ago·Last reply 1 year ago
4 comments
RAPID BI Support
·1 year agoHey Astroraf ,
I think you'd have less head/heartache by just creating a dimWeeks and attaching a string in the format you want from a datamodel perspective - but this wouldn't be as tightly integrated into the filters panel (multiple filters, etc.)
Here is a dashboard script that waits for the weeks in the dropdown to exist, and then changes their text relative to their original text.
It's a bit of a mess - but you could change the result text by adjusting the getSundayFromWeekNum function at top. Not sure what effect it'll have on performance as it always checks for there to be an element created consistent with the weeks filter, and then when it exists it changes the text values - would be worthwhile testing and iterating before deploying.
If I had more time, i'd experiement with destroying the observer when not needed anymore - but not sure how that'd work and how the list is generated after the fact.
Let me know how you go?
Thanks,
Daniel
RAPID BI
daniel.ranisavljevic@rapidbi.com.au
RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons
DRay
·1 year agoGotcha. Let's see if one of the more qualified members of the community can provide a solution.
Rafael Ferreira
OP1 year agoHi DRay ,
I am specifically trying to get the date filter in the first section to be changed to the format above, the provided answers don't have necessarily a specific solution for this format. The image below is the specific filter I am trying to format.
DRay
·1 year agoHi Astroraf,
Thank you for reaching out.
I found these that may help: https://community.sisense.com/t5/knowledge/using-native-javascript-date-calculations-to-modify-sisense-date/ta-p/18812
https://community.sisense.com/t5/knowledge/change-weekly-formating-quot-week-x-quot-to-date-mm-dd-yyyy/ta-p/9066
https://community.sisense.com/t5/knowledge/expanding-on-using-native-javascript-date-calculations-to-modify/ta-p/19534
https://community.sisense.com/t5/knowledge/localization-in-sisense-or-how-to-control-date-and-numbers/ta-p/5336
Can you take a look at those and let us know if they help?