The CONCATENATE operator is used to combine two or more string operands. When this operator is used with string operands it concatenates them or joins them together. The information related to the CONCATENATE operation includes a list of all the operators that are supported in Power Query. This article discusses when we should use this operator and how it operates on different types of data.
It is important to remember that when you use the CONCATENATE operator, it will combine all of your values into a single string. For example:
‘This’: ‘is’: ‘important.’ = “This is important.”
To concatenate two strings together in this instance, we could type them side-by-side inside the CONCATENATE operator.
This: is important. The information related to this operation includes a list of all the operators that are supported in Power Query. This article discusses when we should use it and how it operates on different types of data.
The CONCATENATE Operator has many uses, but they generally boil down to combining two or more string operands into one string by repeating one or more string operands as necessary with an additional concatenation symbol (space) between them.”
This example shows you what happens when the “CONCATENATED” text is cut off before reaching the boundary of your cell for viewing purposes only!
We can also add any other type of data to the CONCATENATE operation such as numbers.
Now: let’s look at a few examples of when and how we might use this operator.
you need to separate each string with space, but now ONLY after your separator symbol (concatenation symbol), which is “&”, so that it reads like below:
This example shows you what happens when the “CONCATENATED” text is cut off before reaching the boundary of your cell for viewing purposes only! When used in combination with other types of data such as numbers or dates, there are some considerations because concatenating strings together can cause implicit type conversions between different data types. For instance, if we were trying to combine two different types of data (e.g., a string and a number) that are not compatible, then the type conversion will result in an invalid value being returned when we perform our concatenation operation.
The concatenate operator is a semi-colon ( ; ). The use of this operator will join two strings together. For example, the string x;y which when evaluated becomes the string “x” followed by “y”. This is an important part of performing arithmetic operations on strings because it provides a way to perform calculations that involve numeral and non-numeral operands.
The following algorithm demonstrates how to add numbers in order from smallest number up to largest:
a = “0”
b= “00”
c=”011″;
while c != “” do a + b; b = c; c=”+-012345″; end while
puts ( a ); //print out the sum of 00 and 01 when evaluated as an expression. The result is 111, which equals 0 plus 11. This would not be possible to get with just one operator since there is no way for an operand like in that case zero to have precedence over the non-numeral operands such as the string “111”. Using concatenation we are able to combine both types of values together so that they work on each other correctly. One more example will show how concatenation can be used to create a string.
a = “x”
b=”y”; // two strings so far; x is not being assigned to anything yet
c=(strcat(“z”,”XY”)); // now c is the symbol z followed by the letters y and x, storing it as one string in memory. Later when we want b+c or c + d (or other combinations), it will work because all of these values are stored inside of their own variable-like container called a string that knows how to store data like this!
puts(strlen(a));// prints out 0 from the above example would also result in an error message if you tried evaluating ‘a’ in the brackets.
puts(strlen(“x”));// prints out 0 because we are concatenating strings together!
a+b; // a equals x and b equal y, so now when you add them together they store as zxyy which is stored in memory as one string (instead of two separate strings).