Forum Discussion

mb0307's avatar
mb0307
Responsive Resident
4 years ago
Solved

Error: convert the value to type List.

Hi

 

Here is a table called FridayTable

 

and this is my code to concatenate a column values into one line text here:

 

{Cube.ApplyParameter, "[!V000004]", {"""" & Text.Combine(FridayTable[DateCol],""", """) & """" }},

 

 

 

and Error I get:

 

 

How can I fix this?

 

Thanks a lot.

  • Thank you and other for looking into this but I have managed to find alrenative solution that worked.

     

    {Cube.ApplyParameter, "[!V000004]", {{ #"Date1" & "", "" & #"Date2" & "", "" & #"Date3" }}},

     

    Date1, Date2 and Date3 are separate queries of text type. 

     

    Thanks again.

8 Replies

  • Hello there mb0307 ! The solution I am gonna give is not a good pratice since you should always provide a specific type of data for a column. Nevertheless, try the following:

    = Table.TransformColumnTypes(#"Previous Step",{{"Column Name", type any}})

    Hope this answer solves your problem!
    If you need any additional help please @ me in your reply.
    If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
    Thanks!

    You can also check out my LinkedIn!

    Best regards,
    Gonçalo Geraldes

  • Hi mb0307 ,

     

    Try putting curly braces around your column reference:

    Text.Combine( {FridayTable[DateCol]} ,""", """)

     

    Pete

    • mb0307's avatar
      mb0307
      Responsive Resident

      BA_Pete  Thanks but now I get this error

       

      Expression.Error: We cannot convert a value of type List to type Text.
      Details:
      Value=[List]
      Type=[Type]

      • BA_Pete's avatar
        BA_Pete
        Super User

         

        Ok, try this:

        Text.Combine( {Text.From(FridayTable[DateCol])} ,""", """)

         

        Pete

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion

    Keep the format of [DateCol] as text, then

    Text.Combine(FridayTable[DateCol], ", ")
    • mb0307's avatar
      mb0307
      Responsive Resident

      CNENFRNL Thanks.  New error:

       

      Expression.Error: We cannot convert the value "20200731, 20200828, ..." to type List.
      Details:
      Value=20200731, 20200828, 20200925, 20201030, 20201127, 20201225, 20210129, 20210226, 20210326, 20210430, 20210528, 20210625, 20210730, 20210827, 20210924
      Type=[Type]

  • mb0307's avatar
    mb0307
    Responsive Resident

    Thank you and other for looking into this but I have managed to find alrenative solution that worked.

     

    {Cube.ApplyParameter, "[!V000004]", {{ #"Date1" & "", "" & #"Date2" & "", "" & #"Date3" }}},

     

    Date1, Date2 and Date3 are separate queries of text type. 

     

    Thanks again.