Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I wonder if you can help.
I have a list of items and a lookup with some of those items within it. I need to assign correct,error based on if there is a match. i have the same for price and size. so i tried the following but it is not returning the expected in my test:
If( ItemLookup =Items , 'Correct', 'Error') as ItemCheck,
If( "Size Conf" = EDISize , 'Correct', 'Error') as SizeCheck,
If( "Price Conf" = EDIPrice , 'Correct', 'Error') as PriceCheck
Should this work?
Thank you
Daniel
I think your script should work. Take a look at my sample script below:
LOAD
rowno() as ID,
ItemLookup, Items,
If( ItemLookup =Items , 'Correct', 'Error') as ItemCheck,
[Size Conf], EDISize,
If( "Size Conf" = EDISize , 'Correct', 'Error') as SizeCheck,
[Price Conf], EDIPrice,
If( "Price Conf" = EDIPrice , 'Correct', 'Error') as PriceCheck
inline [
ItemLookup, Items, Size Conf, EDISize,Price Conf, EDIPrice
TOM H TML1, TOM H TML1, 15, 15, 18, 18
TOM H TML1, TOM H TML2, 15, 14, 18, 17
];
It will return this output:
If you have trouble you could try to trim your fields before comparing.
If( trim(ItemLookup) =trim(Items) , 'Correct', 'Error') as ItemCheck,
If( trim("Size Conf") = trim(EDISize) , 'Correct', 'Error') as SizeCheck,
If( trim("Price Conf") = trim(EDIPrice) , 'Correct', 'Error') as PriceCheck
try this
If( ItemLookup ='Items' , 'Correct', 'Error') as ItemCheck,
If( "Size Conf" ='EDISize' , 'Correct', 'Error') as SizeCheck,
If( "Price Conf" ='EDIPrice', 'Correct', 'Error') as PriceCheck
thank you for the response,
I tried this and i still get error where i would expect correct
Daniel
I think your script should work. Take a look at my sample script below:
LOAD
rowno() as ID,
ItemLookup, Items,
If( ItemLookup =Items , 'Correct', 'Error') as ItemCheck,
[Size Conf], EDISize,
If( "Size Conf" = EDISize , 'Correct', 'Error') as SizeCheck,
[Price Conf], EDIPrice,
If( "Price Conf" = EDIPrice , 'Correct', 'Error') as PriceCheck
inline [
ItemLookup, Items, Size Conf, EDISize,Price Conf, EDIPrice
TOM H TML1, TOM H TML1, 15, 15, 18, 18
TOM H TML1, TOM H TML2, 15, 14, 18, 17
];
It will return this output:
If you have trouble you could try to trim your fields before comparing.
If( trim(ItemLookup) =trim(Items) , 'Correct', 'Error') as ItemCheck,
If( trim("Size Conf") = trim(EDISize) , 'Correct', 'Error') as SizeCheck,
If( trim("Price Conf") = trim(EDIPrice) , 'Correct', 'Error') as PriceCheck
I see you have this working as expected, thank you, i will start to strip back the tables and see where the issue is arising.
Thank you so much for taking the time to look at this and show your findings.
Regards,
Daniel