Group_Concat Freehand SQL
I am working on a Student Evaluation report that includes Course Name and Event Title columns. Each course consists of multiple events; however, the evaluation is conducted at the course level. While generating the report, the same evaluation appears for each event instead of being displayed just once per course.
To resolve this, I want to use GROUP_CONCAT to combine all events for a given course into a single line, separated by commas. For example, the Event Title column for an Anatomy course should display: Exam 1, Exam 2, Quiz 1, Quiz 2.
I am currently using a Calculated Field with a Freehand SQL query, but I am encountering an error (as shown in the attached image). Is there a better approach to achieve this, or is there a way to resolve the issue with the Freehand SQL query?
Thank you!
Hello Rushil,
My name is Siddartha Pathi from the Yellowfin Technical Support Team. We have received your support request, and I will be your primary contact on the following ticket:
Ticket Number: #{31905}
Case Title: {Group_Concat Freehand SQL}
Please allow us some time we will get back to you shortly. If you have any further questions or need assistance, please reach out to us. We're here to help.
Sincerely,
Siddartha Pathi
Yellowfin Technical Support Engineer
Hello Rushil,
My name is Siddartha Pathi from the Yellowfin Technical Support Team. We have received your support request, and I will be your primary contact on the following ticket:
Ticket Number: #{31905}
Case Title: {Group_Concat Freehand SQL}
Please allow us some time we will get back to you shortly. If you have any further questions or need assistance, please reach out to us. We're here to help.
Sincerely,
Siddartha Pathi
Yellowfin Technical Support Engineer
Hello Rushil,
Greetings of the day
Thank you for your patience. From what I gather, GROUP_CONCAT typically requires a SELECT statement; however, Freehand SQL in a calculated field does not permit the use of a SELECT statement.
To concatenate multiple columns, you can create a calculated field that combines each of the string columns. Alternatively, you can utilize the CONCAT function within the Freehand SQL in the calculated field. I have included a video for your reference.
Is this what you were seeking? If you have any additional questions or need further assistance, please don't hesitate to reach out to us.
Sincerely,
Siddartha Pathi
Yellowfin Technical Support Engineer
Hello Rushil,
Greetings of the day
Thank you for your patience. From what I gather, GROUP_CONCAT typically requires a SELECT statement; however, Freehand SQL in a calculated field does not permit the use of a SELECT statement.
To concatenate multiple columns, you can create a calculated field that combines each of the string columns. Alternatively, you can utilize the CONCAT function within the Freehand SQL in the calculated field. I have included a video for your reference.
Is this what you were seeking? If you have any additional questions or need further assistance, please don't hesitate to reach out to us.
Sincerely,
Siddartha Pathi
Yellowfin Technical Support Engineer
Hi Siddartha,
Thank you for your quick response. I want to concat rows, not the columns as you shown in your video by using CONCAT syntax.
I am attaching a picture with this email. The Evaluation is done on the Course, and not the Events. Hence, I want to see one evaluation per course. The report currently is showing indentical evaluation for each events rather than once per course. If you refer to the picture, I want to see Exam 1, Exam 2, Learning Objective written in one single row, separated by commas.
I hope I am making sense here. If you can guide me how to do that, that would be great.
Thank you.
Hi Siddartha,
Thank you for your quick response. I want to concat rows, not the columns as you shown in your video by using CONCAT syntax.
I am attaching a picture with this email. The Evaluation is done on the Course, and not the Events. Hence, I want to see one evaluation per course. The report currently is showing indentical evaluation for each events rather than once per course. If you refer to the picture, I want to see Exam 1, Exam 2, Learning Objective written in one single row, separated by commas.
I hope I am making sense here. If you can guide me how to do that, that would be great.
Thank you.
I’m not sure if this will solve your problem, but the Yellowfin function that gives you a result similar to GROUP_CONCAT in MySQL and MariaDB is STRING_AGG, This way, you can concatenate, for example, the text from multiple rows into a single one as shown in the example below:
You need to specify the column and the separator.
I’m not sure if this will solve your problem, but the Yellowfin function that gives you a result similar to GROUP_CONCAT in MySQL and MariaDB is STRING_AGG, This way, you can concatenate, for example, the text from multiple rows into a single one as shown in the example below:
You need to specify the column and the separator.
Hello Rushil,
Greetings of the day
Thank you for your response. As Flavio Crisler mentioned, to concatenate rows in a report using Freehand SQL in a calculated field in Yellowfin, you can employ SQL functions that are specific to your database system.
The appropriate SQL function for concatenating rows based on your database system. Common functions include STRING_AGG for SQL Server and PostgreSQL, and GROUP_CONCAT for MySQL.
Here are examples of different databases:
Please let me know if there is anything further I can do to address this matter.
Sincerely,
Siddartha Pathi
Yellowfin Technical Support Engineer
Hello Rushil,
Greetings of the day
Thank you for your response. As Flavio Crisler mentioned, to concatenate rows in a report using Freehand SQL in a calculated field in Yellowfin, you can employ SQL functions that are specific to your database system.
The appropriate SQL function for concatenating rows based on your database system. Common functions include STRING_AGG for SQL Server and PostgreSQL, and GROUP_CONCAT for MySQL.
Here are examples of different databases:
Please let me know if there is anything further I can do to address this matter.
Sincerely,
Siddartha Pathi
Yellowfin Technical Support Engineer
Replies have been locked on this page!