View Total

I swear I am having a brain fartI have a view that is trying to total a column that contains a list of numbers

However for some reason, I can only get it to total the first value in the list

I have to do this calc in the view, Each of the values are on one doc

What am I doing wrong?

gNormal := ttlbatch;

gTwo := @Text(Qty1) : @Text(Qty2);

gThree := @Text(Qty1) : @Text(Qty2) : @Text(Qty3);

gFour := @Text(Qty1) : @Text(Qty2) : @Text(Qty3) : @Text(Qty4);

gFive := @Text(Qty1) : @Text(Qty2) : @Text(Qty3) : @Text(Qty4) : @Text(Qty5);

gSix := @Text(Qty1) : @Text(Qty2) : @Text(Qty3) : @Text(Qty4) : @Text(Qty5) : @Text(Qty6);

gSplitOrderNumber := @If(SplitOrderNumber = 2; gTwo; @If(SplitOrderNumber = 3; gThree; @If(SplitOrderNumber = 4; gFour; @If(SplitOrderNumber = 5; gFive; @If(SplitOrderNumber = 6; gSix; “”)))));

gResult := @TextToNumber(@Explode(gSplitOrderNumber; “:”));

@If(SplitOrderFlag = “”; gNormal; gResult)

Subject: View Total

Have you tried summing up gResult? Perhaps you should change the last line as follows…

@If(SplitOrderFlag = “”; gNormal; @Sum(gResult))

I hope this helps.

(P.S. I’m not sure why you need the @Explode statement, because it appears that gSplitOrderNumber is already a list.)

Subject: RE: View Total

I can not do a @sum in the code, it throws off the view when it does the totals

The code that you see, is one of many attempts to get this working