Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

How to quickly find out which field is not unique?

Hi,

quite often I want to test whether a keyfield is unique in a given table. When I find out that it is not - when I select one key, I get several records - how can I find out which field has several distinct values (apart from looking through all the fields which can take a while if a table is broad)?

Thanks a lot!

Best regards,

DataNibbler

12 Replies
marcus_sommer

I think this tool is from Ralf Becher and here was already a quite similar discussion: Re: Chart with count of $Field values.

- Marcus

datanibbler
Champion
Champion
Author

Hi Dimitrios,

I cannot provide you a sample app, but I can tell you how I would do it for now, not knowing a faster way:

I would have a table_chart with the internal key (identical to the key, but not linked to other tables) as the dimension and >> COUNT([fieldname] << (as # of distinct values) for every field as measures.

That does not save me much time or effort compared to just looking through a heap of listboxes to find which field is not unique, but it does return me exactly what I want - most fields will only have a nr. 1 here, one or several will have a value >1.

Best regards,

DataNibbler

Oops, forgot the DISTINCT - it should be >> COUNT(DISTINCT [fieldname]) << - if I add that as expression once for every field, that will not save me much effort, but it will return just what I'm looking for.

dapostolopoylos
Creator III
Creator III

Whatever works Friedrich, sometimes "dirty" solutions are all we really need

Best regards

Father/Husband/BI Developer