Forum Discussion
SteveApa
1 year agoFrequent Visitor
Create a string Column in Advanced Editor
Hi All... How do I create a new column (named Type) in advanced editor and set it to a string value? let Source = Sql.Database("XXXXXX", "YYY", [Query=" select [Proj] as ""Proj#"", null as ""...
- 1 year ago
Sorry... But you are all incorrect. I had a different typo. It does work to assign a "string" to a new column in a select statemement:
let
Source = Sql.Database("xxxx", "yyy", [Query="
select
'GDC' as ""Type""
from
[table1]union
select
'bill' as [Type]
from
[table2] bill
"])
in
Source
Cookistador
Super User
1 year agoIf I remember well, you cannot
You have to add the text column with
AddedTypeColumn = Table.AddColumn(Source, "Type", each "special", type text)
NULL and numeric values are often handled seamlessly because they are less ambiguous.