Crosstab tool concatenated outfield field size limits
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm trying to use crosstab tool to build a long comma separated list in a single field.
I set the size to 1 million.
The concatenated length should be 13728 but it is truncating at 13558
Solved! Go to Solution.
- Labels:
- Best Practices
- Bug
- Dynamic Processing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @hroderick-thr ,
I tried to replicate the same and found the field size to pick up the '200000' defined in the Cross Tab tool. Please refer to the attached workflow.
Can you please confirm the field length you see for the concatenated field after the Cross Tab. You can see this by place a select right after. I ask as sometime the truncating happens because of field sizes defined in subsequent tools.
Best,
Jagdeesh Narayanan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Good idea @JagdeeshN but still not working
Before the tool, I trimmed the input field size to 15 and the concatenated output field from 2 million to 20k. The output of crosstab tool is shown below.
I also did a length formula on the concatenated x2 field to see 13,558
and the rightmost characters are ,'997389422','998290299','9985109
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @hroderick-thr,
Perhaps you have duplicate values in your data. Crosstab automatically removes/combines duplicates, which would explain why your string is shorter than anticipated. You can test this by putting a unique tool in front of your crosstab and seeing what emerges from the D anchor. If you want to find exactly which strings are duplicates, you can use summarize to group by each string and count how many times it appears.
Looks like you might be able to use summarize to achieve the desired result since you're only grouping by one field. I'm pretty sure Summarize concatenates based on incoming row order, which will not remove duplicates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think I mistook the root cause of my problem.
I could not reproduce the error with only the crosstab tool and may have been misled by message truncation.
The failure was happening when I inserted the string prepared by crosstab tool into dynamic sql tool. I now suspect the true bug is in some limit of that tool or the sql driver it uses.
To correct, I put the dynamic sql into an iterative macro and split my long list of values into several lists containing a limited number of values that dynamic sql could process.
Thanks for all the ideas offered!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
