Forum Discussion

leebaldwin's avatar
leebaldwin
Icon for Helper I rankHelper I
3 years ago
Solved

Trouble concatenating fields together in query

I am beginning to learn Power BI and have ran into an issue. I am connecting to an IBM AS400 system and pulling data with no issue; however, when I try to concatenate a few fields together I get an error:

[DB2 for i5/OS]SQL0170 - Number of arguments for function CONCAT not valid."

 

My custom query is as follows:

select DISTINCT fmwhse AS WAREHOUSE, fmstyl AS STYLE, fmclr AS COLOR, fmsize AS SIZE, fmback AS BACKING, concat(fmstyl,'.',fmclr,'.',fmsize,'.',fmback)

 

I know there are some differences in syntax, so it is probably something very minor that I am doing incorrectly. 

  • If you want to create the concatenated column once the query is loaded, you can add a new column and use the option of "Column from examples"

3 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    If you want to create the concatenated column once the query is loaded, you can add a new column and use the option of "Column from examples"

  • PaulDBrown Thanks for the quick reply. I would prefer to do it in the query. I am the type of user that prefers to automate as much upfront as possible. If there is no way to do it, that is fine, I will do it after I get the data into PBi, I am just used to being able to do it inside a query. 

  • I solved this issue by inserting a new column and using CONCATENATEX. Took a lot of researching, but I finally found the solution I needed. Thank you PaulDBrown for your assistance as your solution would work as well.