Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple Conditions and Multiple variables in set analysis

I have a pivot chart where I am trying to calculate a field called available capacity..  But this based on a variable and another field.

I want to say:

if vshowearnedhours=1

then 

if pooled=' ' sum (availablecapacity)

or if pooled='x'

sum availablecapacity/count (distinct [work center])

I tried doing set analysis and here is what I have but it is not working at all..

=if($(vShowEarnedHours),
Sum({$<Poolk={''}>}AvailableCapacity) + sum({$<Poolk={'X'}>}AvailableCapacity/Count(DISTINCT [Work Center])))

4 Replies
sunny_talwar

May be try this?

=If($(vShowEarnedHours) = 1,

     If(Len(Trim(Poolk)) = 0, Sum(AvailableCapacity),

          If(Poolk = 'X', sum(AvailableCapacity)/Count(DISTINCT [Work Center]))))

Not applicable
Author

thanks, but does not work.. no results..

sunny_talwar

Would you be able to share a sample or some sample data to show what exactly are you trying to achieve? May be knowing the input and output might help me better understand the issue and give you a solution.

Best,

Sunny

shraddhawalekar
Partner - Contributor II
Partner - Contributor II

Try Something like this.

=Sum({$<ShowEarnedHours={1},Poolk={''}>}AvailableCapacity)

Sum({$<ShowEarnedHours={1},Poolk={'X'}>}AvailableCapacity/Count(DISTINCT [Work Center]))