Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yoganantha321
Creator II
Creator II

How to get only distinct values in all columns

Hi,

I have a requirement to get only distinct values in all the columns.

Example:

S.NONameStandard
1Yoga1
2Yoga2
3Yoga3
4Nantha1
5Nantha3
6Prakash 2
7Prakash 1

I want to load S.NO 1,2,3,4,5,6,7 Name Yoga,Nantha,Prakash and Standard 1,2,3

How to load only distinct fields for all the columns.

Can anyone help me

Regards,

Yoganantha Prakash G P

7 Replies
Anil_Babu_Samineni

What is the expected result?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishsaggi
Champion III
Champion III

What is your expected output? When you load the above table as is and use list box it will display all the distinct values for their respective columns. What is the issue?

yoganantha321
Creator II
Creator II
Author

My expected result is  like this which have distinct values in all the three columns

 

S.NONameStandard
1Yoga1
2Nantha2
3Prakash3
4
5
6
7
yoganantha321
Creator II
Creator II
Author

I want it while loading itself not to use in listbox or table box

ahaahaaha
Partner - Master
Partner - Master

Hi,

This will automatically happen when you download

RonaldDoes
Partner - Creator III
Partner - Creator III

Hi Yoganantha,

You could use:

SNo:

LOAD DISTINCT S.NO

FROM

[Source.xlsx]

(ooxml, embedded labels, table is Sheet);

Name:

LOAD DISTINCT Name

FROM

[Source.xlsx]

(ooxml, embedded labels, table is Sheet);

Standard:

LOAD DISTINCT Standard

FROM

[Source.xlsx]

(ooxml, embedded labels, table is Sheet);

This would leave you with three unrelated tables with just the distinct values for S.NO, Name and Standard.

eduardo_dimperio
Specialist II
Specialist II

ronalddoes  is right, you can use that but the result will be unrelated tables, cause the concept of distinct is about line and not collum.

For that reason if you use Distinct in your code nothing will change about your output, once that all line in your already unique.