Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

Aggregate Calculation Dimension Help

I have the following columns

TOTAL CARTONS Count(distinct CASE#)

TOTAL PIECES num(sum(UNITS#),'#,##0')

TARGET CARTONS sum(aggr(HOURS,USER_NAME,DATE,SUPERVISOR))*29

TARGET PIECES sum(aggr(HOURS,USER_NAME,DATE,SUPERVISOR))*74

I am trying to COUNT DISTINCT the USER_NAME for each row in the column OPERATORS AT RATE based on condition that TOTAL CARTONS >= TARGET CARTONS something like this:

aggr(count(distinct IF(TOTAL CARTONS >= TARGET CARTONS, USER_NAME), DIMENSION....)


What dimension do I use here to get the right output of OPERATORS AT RATE for each SUPERVISOR per WEEK?


SS.PNG

1 Solution

Accepted Solutions

Try this

Count(DISTINCT Aggr(

If(

Count(DISTINCT CASE#)/(Sum(Aggr(HOURS,USER_NAME,DATE,SUPERVISOR))*29) >= 1 or

Sum(UNITS#)/(Sum(Aggr(HOURS,USER_NAME,DATE,SUPERVISOR))*74) >= 1,

USER_NAME), SUPERVISOR, USER_NAME))

View solution in original post

19 Replies
Creator III
Creator III

Hi Haneesh,

You can try the following:

if( TOTAL CARTONS >= TARGET CARTONS, sum(aggr(count(distinct USER_NAME),WEEK_START)) )

Hope that works,

Carlos M

Creator II
Creator II

Hi Carlos,

I don't get any output. I just get '-'.

Specialist II
Specialist II

May be you can use i- if(column(2)>column(4), UserName), you might not aggregation function.

Creator II
Creator II

Already tried this Neelam, it did not work.

Specialist II
Specialist II

Can you share a sample??

Creator III
Creator III

Would be useful if you share your example. Also check the field names match your data model.

Thanks,

Carlos

Champion III
Champion III

Hope you are using square brackets around your label names like [Total Cartons] >= [Total Targets]

did you try like below:

= IF(Count(distinct CASE#) >= sum(aggr(HOURS,USER_NAME,DATE,SUPERVISOR))*29 , USER_NAME)

Creator II
Creator II

Yes, I did use [ ] and also did the above earlier but it did not work.

Creator II
Creator II

What do you want me to exactly share? It's an official document hence cannot share the qvw