Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

stephenhasson
Contributor

Problem with conditional logic

Hi, in the attached, field ‘%-age of Total Hrs’ is correct, e.g.  14.78/1040.37*100 = 1.42%

For the figures shown (examples in yellow), I want to express the value of labour hours as a percent of the Indirect or Productive hours respectively (ie 1040 is a combination of 200 ‘I’ and 840 ‘P’ hours.

So, I need to combine some conditional logic in the calculation of these percentage. I’ve tried:

Sum([Labour Hrs])/Sum({$<[Labour Type]={'I'}>}(TOTAL([Labour Hrs]))*100

and some variations, but I can’t get the combination of TOTAL and the conditional function to work.

Can anyone please help, thanks.



2 Replies
MVP
MVP

Re: Problem with conditional logic

May be this

Sum([Labour Hrs])/Sum(TOTAL <[Labour Type]> [Labour Hrs])*100

stephenhasson
Contributor

Re: Problem with conditional logic

Thank you for your reply. I'll try this.