Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Solution: SubStringCount is case-sensitive.
I am trying to create an extra column in load. The value should be "Yes" if one of the existing columns contains one of two substrings.
LOAD Name, "Type", "Year", Hits, if((SubStringCount([Name],'community')>0 OR SubStringCount([Name],'operative')>0),'Yes','No') AS [CC], Latlong FROM [lib://AttachedFiles/MyFile.csv]
How do I modify my on-the-fly column creation expression in order to get it right?
Substringcount is case sensitive. Are you sure the records that are missing do have the complete lowercase 'community' value in the field Name?
Substringcount is case sensitive. Are you sure the records that are missing do have the complete lowercase 'community' value in the field Name?
I have just spotted the case disagreement, fixed it, and came here to share my discovery. Thank you for beating me to it.
Here are some case insensitive ways to write the same logic.
if( WIldMatch([Name],'*community*', '*operative*'),'Yes','No') AS [CC]
if( [Name] like *community*' or [Name] like '*operative*', 'Yes', 'No') AS [CC]
-Rob
I agree that the on-line help layout sometimes just doesn't do the trick. I find the PDF versions much easier to browse and search. You can download PDFs from the "Guides" section found at the bottom of the help navigation menu for each product.
-Rob