Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sreerangasane
New Contributor III

How to get single distinct value from two columns in expression

hi

my requirement to get distinct value from two columns. i need this in dimension expression

lets say my data rows will be look like this

IdOriginstateDestinationSate
1PAVA
2PATX
3
TX
NY
4FLMA

Finally i need data look like below as single value in expression

ex:

state
PA
VA
TX
NY
FL
MA

please advise me how to get this

3 Replies
MVP
MVP

Re: How to get single distinct value from two columns in expression

You can follow the idea presented in

Canonical Date

It doesn't really matter if the field is holding dates or states, just create the link table as described.

sreerangasane
New Contributor III

Re: How to get single distinct value from two columns in expression

query4.png

i tried it but its showing  syntax errors

How to write that in expression not in edit script

MVP
MVP

Re: How to get single distinct value from two columns in expression

I (strongly) recommend that you prepare a link table in your model.