Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Translation issue in if-statement

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 ?



6 Replies
Highlighted

Re: Translation issue in if-statement

Wait what is a dimension and what is an expression? I am confused

Highlighted
Master II
Master II

Re: Translation issue in if-statement

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'))

Highlighted
Contributor
Contributor

Re: Translation issue in if-statement

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

Sans titre2.png

=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

Sans titre.png

Is there any solution without using variables ?

Highlighted

Re: Translation issue in if-statement

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'))

Highlighted
Contributor
Contributor

Re: Translation issue in if-statement

I've already tried, neither of these work.  

I think, there is a problem with the = sign  to assign the value of the translation.

Highlighted

Re: Translation issue in if-statement

Would you be able to share a sample?