Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
gizzel123
Creator
Creator

apply distinct in qv data model

Hi

I have a query-select distinct col1,col2... From table 1 ,table 2 where....

..

so I have implemented the whole logoc except the distinct.

if I ll check my model by not including distinct.its fine.

but the business requirement is to have distinct.

can u guys please help.

I really stucked.

thanks in advance   

5 Replies
Anonymous
Not applicable

Not clear what exactly is wrong if you use distinct.  Need some more info...

NickHoff
Specialist
Specialist

Qlikview will automatically group your data based on how you build your data model.  So the DISTINCT logic is being built in without actually using DISTINCT.  However, everything depends on how your data model is setup DISTINCT can be useful to help limit your data set in certain cases.

gizzel123
Creator
Creator
Author

so where do I apply the distinct in script,

I am a novice in qlikview modelling.

is it in load distinct * resident table_name; ???

but this way I get zero records.

NickHoff
Specialist
Specialist

You missed the point.  If Qlikview automatically groups your data based on how your data model is built, it's already applying distinct.

However, if you are attempting to limit your data set in the load.  Then distinct is a predicate used if only the first of duplicate records should be loaded  Typically

You'll have

LOAD COUNT(DISTINCT Field1) AS Field1Count ,

          Field1,

          Field2,

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can also apply DISTINCT as a keyword right after LOAD

LOAD DISTINCT

field1,

field2

field2

...

-Rob