Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Min / Max with Slider

Need a little help with my min max calculation.  Does anyone see a problem with it?  This is a calculated dimension. Thanks

if(aggr(sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt),[PC Desc]) /
    aggr(sum(EmployeeCnt),[PC Desc]) >= $(vMin),[PC Desc] and
   (aggr(sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt),[PC Desc]) /
    aggr(sum(EmployeeCnt),[PC Desc]) <= $(vMax),[PC Desc]
)

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

Are you sure that you need all these aggr? All have the same dimension and therefore the following might be working, too:

aggr(if(
   sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt) /
   sum(EmployeeCnt) >= $(vMin) and
   sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt) /
   sum(EmployeeCnt) <= $(vMax),[PC Desc]
),[PC Desc])

- Marcus

View solution in original post

3 Replies
m_woolf
Master II
Master II

I think the red parenthesis at the start of the third line should be removed.

if(aggr(sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt),[PC Desc]) /
    aggr(sum(EmployeeCnt),[PC Desc]) >= $(vMin),[PC Desc] and
   (aggr(sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt),[PC Desc]) /
    aggr(sum(EmployeeCnt),[PC Desc]) <= $(vMax),[PC Desc]
)

marcus_sommer

Are you sure that you need all these aggr? All have the same dimension and therefore the following might be working, too:

aggr(if(
   sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt) /
   sum(EmployeeCnt) >= $(vMin) and
   sum({<DDDC_Days = {"< 0"}>} DDDC_Cnt) /
   sum(EmployeeCnt) <= $(vMax),[PC Desc]
),[PC Desc])

- Marcus

tmumaw
Specialist II
Specialist II
Author

Thanks.  Worked perfect.