+ Reply to Thread
Results 1 to 4 of 4

power query error: we cannot apply operator - to types text and number

  1. #1
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Question power query error: we cannot apply operator - to types text and number

    Hi guys,

    I have a custom code running in Power Query that I got from a closed thread in another forum, and I can't figure this error out. It worked fine on the file from other forum.

    Code is

    let
    Source = Excel.CurrentWorkbook(){[Name="Table5"]}[Content],
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Repeat("a,",[VARIATION COUNT FIXED]-1)&"a"),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Custom", {{"Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Custom"),
    #"Removed Columns" = Table.RemoveColumns(#"Split Column by Delimiter",{"Custom"})
    in
    #"Removed Columns"






    Error comes back at me saying "we cannot apply operator - to types text and number".

    Please help!

    Thanks

    Logan
    Last edited by loganpmgoa; 02-13-2019 at 07:41 PM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: power query error: we cannot apply operator - to types text and number

    Please post some sample data from Table5
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10
    Quote Originally Posted by Olly View Post
    Please post some sample data from Table5
    OK thanks I will when i get into work today, is it OK if i post the entire file? The weird thing is it worked on a small file that i received from the forum, but not on my large file. It's a very large file, and I'll have to post it as a link with spaces between since I can't post links yet.

    I'll also do some tests with the same powerquery code with a new file, to see if it works on that one, and then a new file set up just like my old file but with way less data.

  4. #4
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Re: power query error: we cannot apply operator - to types text and number

    nevermind, i ended up figuring it out. it had to do with unsupported characters and changing the data type using the power query titles row, as well as making sure there were numbers in all the cells in the column that needed to be numbers to work. Apparently they couldn;t be blank.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  2. Power Query Error
    By vibajajo64 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-20-2018, 11:42 AM
  3. error in power query & power pivot
    By Baldev Kumar in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 01-03-2018, 01:34 AM
  4. [SOLVED] Syntax error (Missing operator) in query expression
    By lengwer in forum Access Tables & Databases
    Replies: 2
    Last Post: 08-22-2013, 04:00 PM
  5. Syntaxt Error (missing operator) in query expression!
    By jdgwebdev in forum Access Tables & Databases
    Replies: 3
    Last Post: 02-25-2013, 09:32 AM
  6. Syntax Error (missing Operator) in query expression
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2011, 11:59 AM
  7. [SOLVED] Syntax error (missing operator) in query expression '6 Wescott Rd#
    By shealy in forum Excel General
    Replies: 0
    Last Post: 06-09-2005, 05:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1