4 Replies Latest reply: Feb 2, 2017 9:00 AM by omkar pechetti

# Concatenate and distinct

Hei,

I've faced an interesting issue.

While making Concetanate I am also using Distinct of the table I do concatenate.

Unfortunately, after that all the values have become Distinct in whole table.

There is an example.

Without Distinct:

TMP:

F1

1

2

1

];

Concatenate(TMP)

F1

3

3

4

];

With Distinct:

TMP:

F1

1

2

1

];

Concatenate(TMP)

F1

3

3

4

];

I would like to understand the fundamentals of this issue. Why is that so?

Thank you!

• ###### Re: Concatenate and distinct

First of all, You need to understand what / how will work for DISTINCT

So, Here For first case it could be definitely correct

For Second one, I can split into few ways

TMP:

F1

1

2

1

];

From Above It will give

Concatenate(TMP)

F1

3

3

4

];

So, For second inline memory it takes as DISTINCT for all F1 Values it will consider as all values which concatenate the first valies

So, Finally It takes like below for all values as DISTINCT function

F1

1

2

3

4

So, From this you can count(F1) then figure it out.

I am not the good explain person but this is the case finally it consider DISTINCT for whole Field due to Concatenate of all Fields which is Associated.

HTH

• ###### Re: Concatenate and distinct

Not entirely sure it happens. But my guess is that since its the same table TMP it assumes to distinct across the whole table. The work around would be....

TMP:

F1

1

2

1

];

Table:

NoConcatenate

F1

3

3

4

];

Concatenate(TMP)

Resident Table;

DROP Table Table;

• ###### Re: Concatenate and distinct

to my idea,

first the qlikview load two tables ,after two tables are appended to one table the Distinct on F1 implemented,

thats why we can see only distinct values when using DISTINCT.