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

What's wrong in my Formula

What's wrong in my formula ?

Sum({$<CHARGE_PROJECT_NC_TYPE ={"BUSINESS DEVELOPMENT"}>} (Sum(Aggr(If(PERSON_ID = PLAYER_PERSON_ID,Sum(If(CHARGE_EXP_ITEM_DATE < PERIOD_MONTH_START OR CHARGE_EXP_ITEM_DATE > PERIOD_MONTH_END,0,CHARGE_ENTERED_HOURS * CHARGE_EMPLOYMENT * EMP_CHARGEABLE))),0),PERIOD_MONTHYEAR,PLAYER_PERSON_ID,PERSON_ID))

2 Replies
Gysbert_Wassenaar

The parentheses don't match up and you're not using an aggr in the outer sum. So you have sum({...}sum(aggr(...)) where you need sum({...}aggr(sum(aggr(...),x,y,z)),p,q,r))


talk is cheap, supply exceeds demand
rlefevre
Contributor
Contributor
Author

Thanks, problem is  I"am getting 0 as result.

My formula who's working for my total hours is where my selection is the Player Person_id :

 

=Sum(Aggr(If(PERSON_ID = PLAYER_PERSON_ID,Sum(If(CHARGE_EXP_ITEM_DATE < PERIOD_MONTH_START OR CHARGE_EXP_ITEM_DATE > PERIOD_MONTH_END,0,CHARGE_ENTERED_HOURS * CHARGE_EMPLOYMENT * EMP_CHARGEABLE)),0),PERIOD_MONTHYEAR,PLAYER_PERSON_ID,PERSON_ID))

and from this total I want only my Business development hours

(this work's when I put in my slection the Person_id)

 

//Sum({$<CHARGE_PROJECT_NC_TYPE ={"BUSINESS DEVELOPMENT"}>}If(CHARGE_EXP_ITEM_DATE < PERIOD_MONTH_START OR CHARGE_EXP_ITEM_DATE > PERIOD_MONTH_END,0,CHARGE_ENTERED_HOURS * CHARGE_EMPLOYMENT * EMP_CHARGEABLE))