Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Integert TO String in Computed Column
rtruban
Hello,
I need to convert an integer to string so I can do a compare of the strings. Is there a way using computed columns to convert an integer to string and then use that computed column in the WHERE statement?
Thanks in advance,
Rob
Find more posts tagged with
Comments
mwilliams
Hi Rob,
Can you explain a little more about your issue? Is there just one integer or many? etc. Thanks.
rtruban
Michael,
Thanks for the response. I actually have a 95% solution using an SQL CAST and SUBSTRING functions in the query instead trying to use a computed column.
I got the CAST to work pretty easily, but quickly found out that some of the values were wrapped in qoutes. I solved that by nesting a SUBSTRING inside of the CAST to strip off the quotes.
Now I can use the resulting integer in a join dataset to bring in another table. All is good
The reason it is only a 95% solution is that I had to create 2 datasets, one to handle the quote-wrapped values and another to handle ones without quotes (doesn't need the SUBSTRING). In a perfect world I would be able to do this with one dataset that can evaluate the string value and determine whether it needs to strip-off quotes or not. I'll save that for another day..
Thanks again for your quick responses!
Rob
mwilliams
Rob,
No problem. Let us know if you have any other questions.