Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am trying to bring in data from a table with the below fields in my edit script
Product_Code
Product_Name
Product_DESCR
I only really need the Product_Code and Product_DESCR, however not every Product Code has a Product DESCR. In the case where there is no product DESCR is there a way to write the script that if the Product DESCR is blank (No Value at all) that the script will return the Product Name as the Product_DESCR?
Thanks,
Try like this
if(isnull(Product_DESCR),Code,Product_DESCR) as data
As above, the only change I would make is not to use the isnull function which is a bit sketchy at times!
if(len(Product_DESCR)<1,Code,Product_DESCR) as data
Hi Guys,
Both your examples work well, only change I had to make was the second Product_DESCR needed replaced with Product_NAME
if(len(Product_DESCR)<1,Prodct_Code,Product_Name) as data
if(isnull(Product_DESCR),Product_Code,Product_Name as data
Cheers.
Can you elaborate more,
am not getting what are you asking here
Can you create tiers of this. Example Below:
If [Field A] is null,
Use [Field B],
If [Field B] is null,
Use [Field C].
Syntax would be helpful! Thanks
if(len(A)>0,A,if(len(B)>0,B,if(len(C)>0,C,'DEFAULT'))) as data
What if don't defined the 3 part in if condition while using in load statement ..
Ex: if (isnull(item), qty)
whether will return the item for not null values
What if I have multiple parameters to pass in? How will I write that?
In this scenerio, only Product_Code and Product_Descr are passed in. Can I pass more than two parameters?