Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression not calculating correctly

Hi

I have been playing around with the following expression to get it to calculate correctly but I cannot get it to behave as I expect. It doesn't matter where I put the brackets it gives me an error in expression. If I leave it as is it is calculating the second part of the expression first.

All 3 part work as individual expressions.

I can add the 2 QTY together without issue and divide one of the 2 QTY figures with the variable.

I want to add the 2 QTY figures together then divide by the variable but what is actually happening is the PICK QTY is getting divided by the variable and then added to the GRN QTY.

=num(Sum ({$<Type={GRN},PONumber-={"*TRANSIT"}>}QTY)+sum({$<Type={PICK}>}QTY)/(vTotalManHours-(vHolidays+vSickness+vHospDocsDentist+vAuthorisedAbsence+vUnauthorisedAbsence+vOvertime+vAgency)),'#,##0.00')

How can I fix this so it adds first then divides?

Thanks Steve

1 Solution

Accepted Solutions
sunny_talwar

May be this:


=Num((Sum({$<Type={GRN}, PONumber-={"*TRANSIT"}>}QTY) + Sum({$<Type={PICK}>}QTY)) /

(vTotalManHours- (vHolidays + vSickness + vHospDocsDentist + vAuthorisedAbsence + vUnauthorisedAbsence + vOvertime + vAgency)), '#,##0.00')

View solution in original post

6 Replies
sunny_talwar

May be this:


=Num((Sum({$<Type={GRN}, PONumber-={"*TRANSIT"}>}QTY) + Sum({$<Type={PICK}>}QTY)) /

(vTotalManHours- (vHolidays + vSickness + vHospDocsDentist + vAuthorisedAbsence + vUnauthorisedAbsence + vOvertime + vAgency)), '#,##0.00')

alexandros17
Partner - Champion III
Partner - Champion III

try this

=Num(Sum({$<Type={'GRN'},PONumber={'*'}-{'*TRANSIT'}>}QTY)+sum({$<Type={'PICK'}>}QTY)/(vTotalManHours-(vHolidays+vSickness+vHospDocsDentist+vAuthorisedAbsence+vUnauthorisedAbsence+vOvertime+vAgency)),'#,##0.00') 

MK_QSL
MVP
MVP

=num((Sum({$< Type={GRN},PONumber-={"*TRANSIT"}>}QTY)+sum({$<Type={PICK}>}QTY))
/

(vTotalManHours-(vHolidays+vSickness+vHospDocsDentist+vAuthorisedAbsence+vUnauthorisedAbsence+vOvertime+vAgency)),'#,##0.00')

Kushal_Chawda

num((Sum ({$<Type={GRN},PONumber-={"*TRANSIT"}>}QTY)+sum({$<Type={PICK}>}QTY))/(vTotalManHours-(vHolidays+vSickness+vHospDocsDentist+vAuthorisedAbsence+vUnauthorisedAbsence+vOvertime+vAgency)),'#,##0.00')

Not applicable
Author

Thanks everyone. I was in danger of putting brackets everywhere but where they needed to go.

Not applicable
Author

Hi Alessandro

unfortunately this gives me the same answer as I was getting which is incorrect.

thanks anyway.

Steve