Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jpjust
Specialist
Specialist

Expression Issue

Hi All,

Can some one please help me figuring out an syntax error on the below expression would be of a great help!

Or if there is another way of writing the same expression, please let me know.

IF(if(len(SUM(CEIL(Avail_S_Units/PP_Q))) =0,0,sum(ceil(Avail_S_Units/PP_Q))) >=If(len(sum(CEIL(Demand/PP_Q))) = 0,0,(sum(CEIL(Demand/PP_Q))-(sum(CEIL([Items Packed]/PP_Q))+ sum(CEIL([Items Shipped]/PP_Q))))),0,
IF(If(len(sum(CEIL(Avail_S_Units/PP_Q))) = 0, 0, sum(CEIL(Avail_S_Units/PP_Q))) < If(len(sum(CEIL(Demand/PP_Q))) = 0, 0, (sum(CEIL(Demand/PP_Q)) - (sum(CEIL([Items Packed]/PP_Q))) + sum(CEIL([Items Shipped]/PP_Q))))),((If(len(sum(CEIL(Demand/PP_Q)))= 0, 0, sum(CEIL(Demand/PP_Q)))) - (sum((CEIL([Items Packed]/PP_Q))) + sum(CEIL([Items Shipped]/PP_Q))))/*packages remaining END*/ - If(len(sum(CEIL(Avail_S_Units/PP_Q))) = 0, 0, sum(CEIL(Avail_S_Units/PP_Q)))))

1 Solution

Accepted Solutions
Vegar
MVP
MVP

A right paranthesis to much.  See my red markings below where I have commented out the paranthesis.

IF(if(len(SUM(CEIL(Avail_S_Units/PP_Q))) =0,0,sum(ceil(Avail_S_Units/PP_Q))) >=If(len(sum(CEIL(Demand/PP_Q))) = 0,0,(sum(CEIL(Demand/PP_Q))-(sum(CEIL([Items Packed]/PP_Q))+ sum(CEIL([Items Shipped]/PP_Q))))),0,
IF(If(len(sum(CEIL(Avail_S_Units/PP_Q))) = 0, 0, sum(CEIL(Avail_S_Units/PP_Q))) < If(len(sum(CEIL(Demand/PP_Q))) = 0, 0, (sum(CEIL(Demand/PP_Q)) - (sum(CEIL([Items Packed]/PP_Q))) + sum(CEIL([Items Shipped]/PP_Q))))/*)*/,((If(len(sum(CEIL(Demand/PP_Q)))= 0, 0, sum(CEIL(Demand/PP_Q)))) - (sum((CEIL([Items Packed]/PP_Q))) + sum(CEIL([Items Shipped]/PP_Q))))/*packages remaining END*/ - If(len(sum(CEIL(Avail_S_Units/PP_Q))) = 0, 0, sum(CEIL(Avail_S_Units/PP_Q)))))

View solution in original post

1 Reply
Vegar
MVP
MVP

A right paranthesis to much.  See my red markings below where I have commented out the paranthesis.

IF(if(len(SUM(CEIL(Avail_S_Units/PP_Q))) =0,0,sum(ceil(Avail_S_Units/PP_Q))) >=If(len(sum(CEIL(Demand/PP_Q))) = 0,0,(sum(CEIL(Demand/PP_Q))-(sum(CEIL([Items Packed]/PP_Q))+ sum(CEIL([Items Shipped]/PP_Q))))),0,
IF(If(len(sum(CEIL(Avail_S_Units/PP_Q))) = 0, 0, sum(CEIL(Avail_S_Units/PP_Q))) < If(len(sum(CEIL(Demand/PP_Q))) = 0, 0, (sum(CEIL(Demand/PP_Q)) - (sum(CEIL([Items Packed]/PP_Q))) + sum(CEIL([Items Shipped]/PP_Q))))/*)*/,((If(len(sum(CEIL(Demand/PP_Q)))= 0, 0, sum(CEIL(Demand/PP_Q)))) - (sum((CEIL([Items Packed]/PP_Q))) + sum(CEIL([Items Shipped]/PP_Q))))/*packages remaining END*/ - If(len(sum(CEIL(Avail_S_Units/PP_Q))) = 0, 0, sum(CEIL(Avail_S_Units/PP_Q)))))