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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
haneeshmarella
Creator II
Creator II

Aggregation help?

I need the count distinct of USER_NAME which meet an IF condition per SUPERVISOR per week.

The fields used are USER_NAME, SUPERVISOR, DATE (MM/DD/YYYY).

The condition is

IF(

IF(Count(distinct

IF(OFF_ON_LINE='OFF-LINE',CASE#))=0,'-',Count(distinct IF(OFF_ON_LINE='OFF-LINE',CASE#)))

/

(sum(IF(OFF_ON_LINE='OFF-LINE', aggr(IF(OFF_ON_LINE='OFF-LINE',HOURS),SUPERVISOR,OFF_ON_LINE,DATE,USER_NAME)))*70) >= 1,

USER_NAME)

The expression I use is

Count(DISTINCT Aggr(If(

IF(Count(distinct IF(OFF_ON_LINE='OFF-LINE',CASE#))=0,'-',Count(distinct IF(OFF_ON_LINE='OFF-LINE',CASE#)))/(sum(IF(OFF_ON_LINE='OFF-LINE', aggr(IF(OFF_ON_LINE='OFF-LINE',HOURS),SUPERVISOR,OFF_ON_LINE,DATE,USER_NAME)))*70) >= 1,

USER_NAME), SUPERVISOR, DATE))

What am I doing wrong?

3 Replies
vishsaggi
Champion III
Champion III

Can you share a sample to look into? And also what is the error you are getting?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Could you explain in words what the logic is?

-Rob

haneeshmarella
Creator II
Creator II
Author

The logic is

If the number of cartons picked divided by target cartons (Hours*70) >=1, then that User meets the target. I am trying to calculate the users count distinct based on that condition, per week per supervisor.

Does this help, Rob?