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: 
mphekin12
Specialist
Specialist

LOAD Distinct Error

I'm hoping someone can help me out.  I'm using LOAD Disctinct to get a table with just the distinct companies we have.  There should only be two rows in this table, but for some reason there are over a million records.  It's like the 'Distinct' keyword isn't working at all.  My script is below:

Company:

     LOAD
           *,
          1 as C.Count
      ;
      LOAD Distinct
           Company as C.Company
      FROM $(vData)\Main.qvd (qvd);

Can anyone tell me why just the distinct companies aren't making it into the Company table?

Any help would be greatly appreciated!

1 Solution

Accepted Solutions
santharubban
Creator III
Creator III

Mphekin,

try this

Company:

  LOAD Distinct
           *,
          1 as C.Count
      ;
      LOAD
           Company as C.Company
      FROM $(vData)\Main.qvd (qvd);

View solution in original post

4 Replies
Anonymous
Not applicable

Hi

Are there any other tables that have the field C.Company ?

What happens if you isolate the load distinct ?

NoConcatenate

DistinctCompany :

LOAD Distinct

           Company as DistinctCompanyField

FROM $(vData)\Main.qvd (qvd);


Best Regards,     Bill

santharubban
Creator III
Creator III

Mphekin,

try this

Company:

  LOAD Distinct
           *,
          1 as C.Count
      ;
      LOAD
           Company as C.Company
      FROM $(vData)\Main.qvd (qvd);

hic
Former Employee
Former Employee

You're right. The distinct keyword is ignored, unless it is found in the topmost Load.

HIC

mphekin12
Specialist
Specialist
Author

Thank you all for your help!