Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

What is the use of Distinct?

Yes I have duplicate records in Excel.

What is the difference in "using distinct keyword" and "not using distinct"?

11 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Anitha,

     I am sure you understood what is mean by Distinct from your below post.

     http://community.qlik.com/thread/76250?tstart=0

     Now the other question of yours is whats the use of distinct keyword.

     So when you use the distinct key word when you are loading the data, it will load only distinct values from your data. Say for example your data is like below.

     Field1, Field 2

       a, 10

       a, 20

       a, 10

     Here you have 3 records where you have 2 records which are identical which is a,10.

     So when you use this.

     Load Field1,Field2 from xyz;

     This will load all 3 records bu when you use.

     Load Distinct Field1,Field2 from xyz;

     This will give only 2 records which are

     a,10

     a,20;

     Hope this is clear.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

I tried with distinct keyword and without distinct keyword. Both return the same result.

a,10

a,20

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     If you are looking them by Listbox, you will find only A and 10,20.

     This is because the List box shows the distinct values.

     Create a Table box and see the difference.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik,

Table Box is also showing the same Result.

Regards

Deepak

Anonymous
Not applicable
Author

I tried in Table box only, no difference in below 2 results.

Load Field1,Field2 from xyz;

Load distinct Field1,Field2 from xyz;

xyz:

Field1     Field2

a          10

a          20

a          10

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Sorry I missed out. Table box will also show the distinct records.

     The other way to find out this is

     Create a Chart with Dimension as Field1 and expression as count(Field2)

     You can also go to Document Properties -> Table -> And see the record count.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Yes perfect!!! Thanks...

Then why it is not displaying correctly in Table box rather than chart?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     You are right Anitha.

     QlikView objects like Listbox and Table Box shows only the distinct records.

     Hope your doubt is clear now.

Regards,

Kaushik Solanki    

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

In listbox also you can find the difference of both Distinct and Not Distinct.

Just take Fiedl1 in listbox and check Show frequency then it will show as below

For Not Distinct:

Field1

A    2

B    1

For Distinct:

Field1

A   1

B   1

Hope it helps you.

Best of luck