Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've a problem with translation in if-statement.
When i enter the field expression in a pie-chart
=if(metier='G',Only({<CODE={groupage}>} [$(=langue)]),if(metier='L','Logistique','Affretement'))
i've got a dimension error.
When i create a variable
groupage with expression =Only({<CODE={groupage}>} [$(=langue)])
and then enter the expression with the variable in the pie-chart
=if(metier='G',groupage,if(metier='L','Logistique','Affretement'))
It's working. Why it doesn't work without variable, is there a problem with the = sign ?
Wait what is a dimension and what is an expression? I am confused
Hi,
Can you share mock data and expected output? and also u can try below way
=if(metier='G',Only({<CODE={groupage}>} $(langue)),if(metier='L','Logistique','Affretement'))
or
=if(metier='G' and CODE='groupage', $(langue)),if(metier='L','Logistique','Affretement'))
The function (fx) Only({<CODE={groupage}>} [$(=langue)]) is the traduction of the code groupage in the users language.
If i put this function in a variable and then use as function in dimension field of chart i've no problem.
like this where groupage is the variable
=if(metier='G',groupage,if(metier='L','Logistique','Affretement')) -> works fine
But if i put the function for the traduction directly, without passing by a variable like this
=if(metier='G',Only({<CODE={groupage}>} $(langue)),if(metier='L','Logistique','Affretement')) -> get error
i've got a message
Is there any solution without using variables ?
May be wrap your Only function within a dollar sign expansion or add a TOTAL Qualifier
=If(metier = 'G', $(=Only({<CODE={groupage}>} [$(=langue)])), If(metier = 'L', 'Logistique', 'Affretement'))
or this
=If(metier = 'G', Only(TOTAL {<CODE={groupage}>} [$(=langue)]), If(metier = 'L', 'Logistique', 'Affretement'))
I've already tried, neither of these work.
I think, there is a problem with the = sign to assign the value of the translation.
Would you be able to share a sample?