Error while concatenating fields

Chetan shared this question 2 years ago
Answered

HI TEam,


I am trying concatenate more than 2 fields in a report via free hand SQL. But I am getting the below error.

/D5xyfEu5EcCaAAAAAElFTkSuQmCC


I can concatenate same fields in Database (MySQL) without any error

Comments (8)

photo
1

Hi Chetan,

I believe this is occurring because the syntax is incorrect:

/9fpgAAAABJRU5ErkJggg==

/D6+Bcyfd9bxKAAAAAElFTkSuQmCC

Also, if these are two fields that exist in YF, why not just use the Simple formula type?/D76vR4EG6mZsAAAAAElFTkSuQmCC

Regards,

Mike

photo
1

Hi Mike,

Its not issue with the syntax as I tried with all possibilities. Cant use simple or pre-defined formulas as I have 5 fields to concatenate.


/wd8zovHH7fhhgAAAABJRU5ErkJggg==

photo
2

Hi Chetan,

It appears the issue is that YF believes these values belong in a table called 'reportDemo2.questions'. If the column wasn't recognized by YF at all, it would show up as:

/wGcNc4H3KBgjgAAAABJRU5ErkJggg==

Rather than what your instance is saying. Does the corresponding table contain these fields in your database? If these fields are contained in a different table than the one you're working in in your report, then prepend your table name to the query like so:

/wOy1g8zjBZwwAAAAABJRU5ErkJggg==

Please let me know how this goes.

Regards,

Mike

photo
1

Hi Mike,

Yes, Table contact contains all the fields which I need to concatenate.

Tried as suggested above but still I am getting the same error.

/xlIFUaHOZRcAAAAASUVORK5CYII=

However I can concat the same two fields by using predefined concatenate function without any error.

/1kzxcVo+K09AAAAAElFTkSuQmCC

PS. I need to concatenate 5 fields here. All the fields belong to same table of a master view.


Thanks,

Chetan

photo
1

Hi Chetan,

Thanks for the response. Can you please attempt 'Contact.Street'+'Contact.Street2' rather than without single quotes? My previous example doesn't work without the single quotes either, for instance. Also please note that when using Freehand SQL you are actually querying the database and not a View within Yellowfin, so it's important to make sure 'Contact' is your actual table name in the db, if you haven't already done so.

Regards,

Mike

photo
1

Hi Mike,

Thanks for help. I am able to concatenate the fields now.

But when use this field in report it's coming up in numeric values. Thats strange!

Am I missing something?


/wFF6xl+xhjX3QAAAABJRU5ErkJggg==


/dMPYH1RKV9kHQppi0LKIqO8tAgG5wNdR6kY+GyuDamiYzSb+P+QMOxZiyh1JAAAAAElFTkSuQmCC


Thanks,

Chetan

photo
1

Hi Chetan,

This depends on which RDBMS you're using. You can reference this article on how to accomplish this: https://www.sqlbook.com/sql-string-functions/sql-concatenate/

In MySQL and Oracle, the script is:

CONCAT(Artist, " ", Album)
As an example. I added , " ", to put a space between values:

/wO4qmw9X1UDoQAAAABJRU5ErkJggg==

Please reference linked article and let me know if you have any further questions.

Regards,

Mike

photo
1

Hi Chetan,

I'm going to go ahead and mark this one as Answered, but if you have further questions or concerns on this, if you respond, it will re-open the case and put it back in my queue and I'll be happy to help.

Regards,

Mike