Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to set the colors dynamically to the values in the master item of a dimension?
For example, for an app that shows the current year and the last two years - the current year will always be shown in blue, the year before it in green and the last year in gray.
So if we look at 2024 then 2024 will appear in blue and 2023 in green. But if we look next year then 2025 will be the current year and will be shown in blue, 2024 will be shown in green and 2023 in grey.
I know it can be defined in this object by expression, but i have a lot objects so I'm trying to make it easier and define it in one place (in case they want to change the colors in the future).
Thanks.
To assign a value to your variable, use the following format:
Set vColor = 'If(year=year(today()), rgb(0,0,255), ...)';
When referencing your variable, ensure to use the following syntax:
$(=vColor)
Best regards Son
Hi, as a workaround you can create a variable that stores the 'by expression' expression, and use this variable in every object, so in case it changes you only need to change the variable value.
Thanks for the response.
How to set colors for values in a formula? There is a smart way to do it or just simply use If and RGB functions?
If(year=year(today()), rgb(0,0,255), ...)
To assign a value to your variable, use the following format:
Set vColor = 'If(year=year(today()), rgb(0,0,255), ...)';
When referencing your variable, ensure to use the following syntax:
$(=vColor)
Best regards Son