
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
LOAD * INLINE [
F1
1
2
1
];
Concatenate(TMP)
LOAD * INLINE [
F1
3
3
4
];
With Distinct:
TMP:
LOAD * INLINE [
F1
1
2
1
];
Concatenate(TMP)
LOAD Distinct * INLINE [
F1
3
3
4
];
I would like to understand the fundamentals of this issue. Why is that so?
Thank you!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at this blog http://www.qlikfix.com/2013/07/30/distinct-can-be-deceiving/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at this blog http://www.qlikfix.com/2013/07/30/distinct-can-be-deceiving/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
LOAD * INLINE [
F1
1
2
1
];
From Above It will give
Concatenate(TMP)
LOAD Distinct * INLINE [
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
LOAD * INLINE [
F1
1
2
1
];
Table:
NoConcatenate
LOAD Distinct * INLINE [
F1
3
3
4
];
Concatenate(TMP)
LOAD *
Resident Table;
DROP Table Table;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
