Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to create an expression for a dimension field to show different group of values within the dimension based on the field selections.
Below is the current expression I have to return only one value and it works properly.
=If(GetFieldSelections(Trade) = 'A', 'A-1', Relation)
However, when I want to return 2 values, seems like the list of values does not work within the if statement.
=If(GetFieldSelections(Trade) = 'A', ['A-1' , 'A-2'], Relation)
Could anyone please help in this case? Much appreciate!
Certainly! It looks like you're trying to handle multiple values within the IF statement. In QlikView or Qlik Sense, you can use the Match() function to achieve this. Here's an example:
=If(Match(GetFieldSelections(Trade), 'A') > 0,
if(Match(Relation, 'A-1', 'A-2') > 0, Relation)
)
This expression checks if the selected value in the 'Trade' field is 'A', and if the 'Relation' field matches either 'A-1' or 'A-2'. Adjust it based on your specific requirements and the structure of your data.
if you can define the relations logically you should be able to associate them in the data model level