Samy
Samy

Reputation: 485

QlikView field name as a dimension in expression

My chart contains this dimension: =if(vDim1='[Column1]','Column2',) but if I do this I will actually have the value "Column2" written in every cell.

How can I make QlikView interpret Column2 as a column name, as opposed to a value? I know it works if I use a variable vDim2 that is equal to: [Column2]: =if(vDim1='[Column1]',$(vDim2),) , but I am interested to know if there is a solution that doesn't use variables? Many thanks in advance!

Upvotes: 0

Views: 3031

Answers (1)

The Budac
The Budac

Reputation: 1633

I think just removing the quotation marks will give you what you want.

=if(vDim1=[Column1],[Column2])

I think the key concept is when are you telling QlikView to return the text in a field or to return only the text you have typed in.

Have a look at this example of using the text qualifier (') vs not using it.

Text vs Field

In the expression editor you can see what QlikView is expecting red words are fields and black ones are text

Qualified Text

Field Names

Upvotes: 1

Related Questions