Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
michielvandegoo
Valued Contributor

Duplicate row in table with exactly the same values, count = no of rows, display = 1 row

Hi, in a qvw I see that an row has duplicate rows. 

In the table viewer I see 8 rows but in a table box only 1 row is shown.

All except 1 connected tables do not have multiple rows either.

This 1 table that has duplicates also has 8 rows, with all rows exactly the same values. A table box shows therefore only 1 row.

Any ideas why I see duplicate rows in the table viewer but not in the results?

 

Labels (2)
2 Replies
MVP & Luminary
MVP & Luminary

Re: Duplicate row in table with exactly the same values, count = no of rows, display = 1 row

All Qlik objects show only distinct values. If you want to display redundant data you need to add a unique key which might be any ID from the data or if there isn't one you could with rowno() and/or recno() create one and use them too into the object. In your case I assume that those multiple records are wrong probably caused through any erroneous join - this means you need to check the relationship between your tables and consider maybe a mapping instead of the joins or some other ways tp build the datamodel.

- Marcus

Re: Duplicate row in table with exactly the same values, count = no of rows, display = 1 row

The table viewer on the contrary is just an inspection tool that shows the "raw" unfiltered data in the internal tables, in addition to some statistics and useful table & field properties.  If you would perform a STORE of that particular table in your load script, you would get the same content as shown in the table viewer (and all rows, not just the first 1000 or so). If on the other hand you export your Table Box using one of the object menu options, you would get a single row like what is shown in the object itself.

Imagine that your table has a field called Customer, and its value is the same in all 8 rows, then

Count(Customer) would return 8 because it counts all values, even duplicates, and

Count(DISTINCT Customer) would return 1 because it only counts unique values in the same way that QlikView only shows unique values in listboxes. 

After all, it's not because data isn't shown that it isn't there.