string-concatenation


ConcatRelated Function Returns All Values


Using Allen Browne's ConcatRelated function is not returning correctly.
Example:
OrderNumber Product Types
00054001021 ROUND
00054001021 WHITE
00054001121 CONCAVE
00054001121 SCORED
00054001121 WHITE
00054001221 CAPSULE
00054001221 SCORED
00054001221 WHITE
Using this:
SELECT DISTINCT YourTable2.OrderNumber, ConcatRelated("[Product Types]","YourTable2","[OrderNumber]="& "[OrderNumber]","[Product Types]",",") AS All_Product_Types
FROM YourTable2;
Is returning all of the ProductTypes for each Order Number:
OrderNumber All_Product_Types
00054001021 CAPSULE,CONCAVE,ROUND,SCORED,SCORED,WHITE,WHITE,WHITE
00054001121 CAPSULE,CONCAVE,ROUND,SCORED,SCORED,WHITE,WHITE,WHITE
00054001221 CAPSULE,CONCAVE,ROUND,SCORED,SCORED,WHITE,WHITE,WHITE
It should be:
OrderNumber All_Product_Types
00054001021 ROUND, WHITE
00054001121 CONCAVE, SCORED, WHITE
00054001221 CAPSULE, SCORED, WHITE
What am I doing wrong?
I actually solved this myself. I needed more quotation marks (") since my Order Number field is text. In case someone else has the same issue, the query should look like this:
SELECT DISTINCT YourTable2.OrderNumber, ConcatRelated("[Product Types]","YourTable2","[OrderNumber]="""& [OrderNumber] & """","[Product Types]",",") AS All_Product_Types
FROM YourTable2;

Related Links

ConcatRelated Function Returns All Values
In java properties file itself can we concatenate two or more than two variables together?
“No message” when writing string with console.log()
Moqui:We can use create an view with concatenating two or more columns as single column. simple can we do concatenatio in moqui view creqtion.
Error in ConcatRelated
String Concatenating functions in Progress 4GL?
sybase - simple concatenation
How do you concatenate strings in a Puppet .pp file?

Categories

HOME
grok
design-patterns
eslint
google-spreadsheet
devise
vscode-extensions
bitbucket-api
cublas
vxml
3d-reconstruction
vsm
google-cloud-datalab
arangodb
nancy
internationalization
charles
blade
event-store
roundup
shared
angularjs-components
outliers
android-maps
uitapgesturerecognizer
sqlpackage
vex
recurring-events
instantiation
sendbird
installscript
html-encode
ideascript
z-notation
gdata
apriori
attributeerror
naming
plr
http-request
uiimage
x++
nanoc
identification
reindex
scalding
arules
cup
quicktime
cmp
vibrate
rxtx
renaming
rmongo
slackware
neon
jodd
eigenvector
jclouds
turbo-prolog
html-to-pdf
user-management
rasterize
xenomai
liquid-layout
j-security-check
dot.js
webfinger
tweenlite
insight.database
build-script
verold
live555
ray
dot42
extjs2
maven-scm
notorm
gtm-oauth2
scrypt
kogrid
mvc-editor-templates
workitem
resource-management
web-farm
azman
stress
flex-mobile
update-statement
xui
vs-android
burndowncharts
strtod
tui
cuda.net
fail-fast-fail-early
application-planning
technical-debt
blind
image-capture
cardspace
wspbuilder

Resources

Encrypt Message