CONCATENATE for a calculation field.
It would be great if there was a possibility to use an access style Concentration in a calculation or merge field.
'[@field:a]' & ' some text ' & '[@field:b]' & ' more custom text.
There is a way to do this with stuff but it is a bit more complex.
A little icing on the cake would be to make it more dynamic with if statements or case functions.
Thanks for continuing to create better functionality and for taking our suggestions on improvements.
Thank you for this idea. The feature is now available in 9.4 Release.
-
Jacob commented
How can you make a virtual field in the initial data page search fields where it combines the first and last name with auto complete? Our customer table would have first and last name in separate columns. I do not see the calculation option in the data page wyzard configure search fields.
Is this possible? -
Matt commented
So, this is actually very simple for anyone who doesn't understand. This works great with Calculations field as follows. [@field:a] + ' xxxx ' + [@field:b] & ' xxxxx '. If any field used is not already text, you might need to convert field to string by wrapping it in the following str([@field:a])
Therefore str([@field:a]) + str([@field:b]) + str([@field:c]) + 'text' works pretty good.
-
Matt commented
Thanks Bahareh. Awesome... Sorry, didn't understand "Select". That is incredibly helpful. I have always made it work with "stuff" however it is very tricky and messy. Thanks so much.
-
Bahareh commented
We can concatenate fields in a calculation field. For example to display full name that concatenates first and last name in a calculated field in tabular results page, write the following code in the calculated field where Last_Name and First_Name are your field names in the table:
SELECT (Last_Name + ', ' + First_Name)
Calculated field runs on the results page load time and is not saved in the table. Calculated field can be downloaded as part of the results page if download option is enabled on the results.
Do you need the field to be saved in the table? If this is the case the feature request is to have the calculation field on the table level.
-
aam82 commented
If I know what you mean, this is working already. For example, I'm using this in a calculated field
SELECT stuff((
SELECT ', ' + field1 AS 'data()'
FROM _v_view1
WHERE field1=[@field:somedatapagefield]
FOR XML PATH('')
), 1, 2, '')the _v_ is for a view
-
Matt commented
For the sake of making this more searchable I would like to add the concept of merging two or more fields together in a single field. Preferably a field that can be exported, downloaded or saved from a report or form.