Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression trouble

I have an expression in my pivot chart   -   sum(if(date_received<=expected_date, qty_received))

I tried putting this in my script rather than have the calculations eating memory in the pivot:

NOCONCATENATE LOAD

order_no,

if(date_received<=expected_date, qty_received) as itemsOnTime

RESIDENT op;

This loads correctly, however when the value "itemsOnTime" is in the pivot I'm getting a 0 value.

But when the expression sum(if(date_received<=expected_date, qty_received)) is in the pivot I receive the corrrect calculation.

Can anyone see anything wrong here? Thanks in advance...

1 Reply
erichshiino
Partner - Master
Partner - Master

Are the numbers there when you put itemsonTime in a listbox?

I guess you should use sum(itemsOnTime) as an expression in the pivot table.

If it doesn't solve it , maybe you could share some data samples so the community can take a look

Regards,

Erich