Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to give count distinct statement in qlik sense load script editor in qlik sense ?

hi ,

how to give the following query in load editor script  what are the terms to be used both in LOAD and SELECT statement -


SELECT "acc_period",

"hospital",

"nationality",

"patient_type",

"admit_status",

COUNT(DISTINCT episode_seq) AS COUNT

FROM "table name"

GROUP BY "acc_period","hospital","nationality","patient_type","admit_status" ;



2 Replies
devarasu07
Master II
Master II

Hi,

script looks fine. What is the issue here?

may be u can also try like this.

Fact:

SELECT "acc_period",

"hospital",

"nationality",

"patient_type",

"admit_status",

"episode_seq",

FROM "table name";

TotalCount:

LOAD "acc_period",Count(episode_seq) as TotCount Resident Fact Group By "acc_period"; // u can further dimension with comma


Thanks,Deva

pradosh_thakur
Master II
Master II

Hi

try this

load acc_period,

hospital,

nationality,

patient_type,

admit_status,

COUNT(DISTINCT episode_seq) AS COUNT

GROUP BY acc_period,hospital,nationality,patient_type,admit_status ;

select *      //use sql select if from database
FROM "table name"


regards

Pradosh


Learning never stops.