Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Multiple condition withing a table

I have a table named ticpr200 and I want to load 3 same dimensions from the same table with different conditions as follows-

1) Material Cost (ticpr200.amnt) - condition to pick this field - ticpr200.cpcc=100 and ticpr200.cpcp=100

2) Operation cost (ticpr200.amnt) - condition to pick this field - ticpr200.cpcc=100 and ticpr200.cpcp=200

3) Inventory Type (ticpr200.amnt) - condition to pick this field - ticpr200.cpcc=100 and ticpr200.cpcp=300

 

I need to load this in the data load editor.

 

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

Like this are you looking for?

 

ticpr200:
load *
,if(ticpr200.cpcc = 100 and ticpr200.cpcp = 100, ticpr200.amt) as [Material Cost]
,if(ticpr200.cpcc = 100 and ticpr200.cpcp = 200, ticpr200.amt) as [Operation Cost]
,if(ticpr200.cpcc = 100 and ticpr200.cpcp = 300, ticpr200.amt) as [Inventory Type]
;

//dummydataa
load * inline
[ticpr200.cpcc, ticpr200.amt, field2, fieldn
1, 100, a, x
2, 200, b, y
3, 300, c, z
]
;

View solution in original post

1 Reply
stevejoyce
Specialist II
Specialist II

Like this are you looking for?

 

ticpr200:
load *
,if(ticpr200.cpcc = 100 and ticpr200.cpcp = 100, ticpr200.amt) as [Material Cost]
,if(ticpr200.cpcc = 100 and ticpr200.cpcp = 200, ticpr200.amt) as [Operation Cost]
,if(ticpr200.cpcc = 100 and ticpr200.cpcp = 300, ticpr200.amt) as [Inventory Type]
;

//dummydataa
load * inline
[ticpr200.cpcc, ticpr200.amt, field2, fieldn
1, 100, a, x
2, 200, b, y
3, 300, c, z
]
;