Hi,
i am getting below results while doing
IF TRIM(((to_transf4.ORDER_TCD[1,1]) <>'S' AND trim(to_transf4.ORDER_TCD<>'')) and (TRIM(to_transf4.COST_CNTR_TCD='') or IsNull(to_transf4.COST_CNTR_TCD))) then 'Y' ELSE 'N'
Peek_186,0: COST_CNTR_TCD:NULL POST_STAT:N DOC_NUM:5001307000 LINE_ITEM: 001. ORDER_TCD:60386276
Peek_186,0: COST_CNTR_TCD:177428 POST_STAT:N DOC_NUM:5001323601 LINE_ITEM: 001. ORDER_TCD:
Peek_186,0: COST_CNTR_TCD:NULL POST_STAT:N DOC_NUM:5001307000 LINE_ITEM: 002. ORDER_TCD:
I except the results to be as below i mean PST_STAY Y for first row
Peek_186,0: COST_CNTR_TCD:NULL POST_STAT:Y DOC_NUM:5001307000 LINE_ITEM: 001. ORDER_TCD:60386276
Peek_186,0: COST_CNTR_TCD:177428 POST_STAT:N DOC_NUM:5001323601 LINE_ITEM: 001. ORDER_TCD:
Peek_186,0: COST_CNTR_TCD:NULL POST_STAT:N DOC_NUM:5001307000 LINE_ITEM: 002. ORDER_TCD:
Issue with logic
Moderators: chulett, rschirm, roy
Since the same action is performed twice, it is more efficient to use a stage variable, but in this case
becomes
That assumes that you want NULL values to equate to an empty string, otherwise the function would be
Code: Select all
(TRIM(to_transf4.COST_CNTR_TCD='')
Code: Select all
(TRIM(NullToEmpty(to_transf4.COST_CNTR_TCD)='')
Code: Select all
(TRIM(NullToValue(to_transf4.COST_CNTR_TCD,'Dummy')='')