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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

loading unique values of a field

hi all,

how can i load a table data against the unique values of a particular field of the table.

i.e. load table party_m with only that data which contains unique values of field party_code

2 Replies
rbecher
MVP
MVP

You can load all distinct party_code values first:

dist_code:
load distinct party_code from party_m;


...and then load all rows where exists party_code:

party_m:
load * from party_m where exists(party_code);


- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
rbecher
MVP
MVP

I got it wrong in the first place.

dist_code:
load party_code where cnt = 1;
load party_code, count(party_code) as cnt from patry_m group by party_code;


Hope this helps.

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine