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: 
AJKhan
Contributor
Contributor

avoiding double count in load group by

Hi,

I have a following load

Data:

load
customer_id,
customer_prd,
date

from data.csv

Data_final:

load

count(distinct customer_id) as No_of Cust,
customer_prd,
date

resident Data
group by (customer_prod,date)

drop table Data;

however problem is, i am getting double/triple counts of the customers as unique customer_id exists across multiple customer_prd . Solution i am looking at is to grab the unique customer counts only across the data sets. Is this possible? thanks 

 

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

May be like this?

Data_final:

load

date,

count(distinct customer_id) as No_of Cust,
Concat(customer_prd,',') As customer_prd,
 

resident Data
group by  date 

View solution in original post

1 Reply
sasiparupudi1
Master III
Master III

May be like this?

Data_final:

load

date,

count(distinct customer_id) as No_of Cust,
Concat(customer_prd,',') As customer_prd,
 

resident Data
group by  date