Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I have the dimension of a graph in a variable vTimeLevel.
In most case, this dimension is the name of a field from a calendar.
Because the field name can contain '-', like mois-année, I need to put it between [] : [$(vTimeLevel)]
But in some other case the value of vTimeLevel is not a field, but a variable : ='if([%KeyDate] >= $(=max(%KeyDate))-7, Date)'
So it does not work either for the dimension case or the variable case.
I've tried all the things I could think of but it doesn't work.
Any idea how I can solve this?
Thanks in advance,
calculated dimensions need to be wrapped in AGGR() as below
also remove single quotes from the expression
vTimeLevel = if([%KeyDate] >= $(=max(%KeyDate))-7, Date)
Dimension =
AGGR ( vTimeLevel , %KeyDate )
OR
AGGR ($( vTimeLevel) , %KeyDate )
Thanks for your reply,
That doesn't solve my problem as when I click on the month button for example to agregate by month, then vTimeLevel=Month-Year Field from the calendar and will not work without brakets.
If I put [vTimeLevel] as dimension then it will work for [Month-Year] field not when I click on last 7 days button : the [vTimeLevel] dimension will be [if([%KeyDate] >= $(=max(%KeyDate))-7, Date)] and will not work...
G'day @bertrand01, this is a curious problem.
Is it possible to include the square brackets in the value of the variable? For example ...
vTimeLevel = '[mois-année]';
When you paste $(vTimeLevel) into the column, it will already include the brackets.
Cheers, Barnaby.
Thanks Barnabyd,
Sorry that I dont expose my problem clearly :
There's buttons affecting the value of the variable vTimeLevel :
It can be for example :
vTimeLevel = [Année] (Year)
vTimeLevel = [Mois-Année] (Year-Month)
vTimeLevel = if([%KeyDate] >= $(=max(%KeyDate))-7, Date)
In my graphs, I have 2 choices for using the dimension :
=vTimeLevel or =[vTimeLevel]
If I use =vTimeLevel, Mois-Année does not work and just shows -Année value (-Year)
If I use =[vTimeLevel], if([%KeyDate] >= $(=max(%KeyDate))-7, Date) does not work as it doesn't understand the [].