+ Reply to Thread
Results 1 to 5 of 5

Power Query - Operator Error

  1. #1
    Registered User
    Join Date
    12-09-2021
    Location
    Stroud
    MS-Off Ver
    365
    Posts
    9

    Power Query - Operator Error

    Hey,

    I'm unable to attach sample data relating to this, so I'm hoping someone has come across the issue before and can offer advice.


    I've grouped multiple 'Time' formatted fields into one. The result is that the majority of the printed fields show as 'Error', with the description saying 'expression error we cannot apply operator + to types time and time'.

    For some fields this has worked, but for the majority I get the error.

    I can only assume it's because time cannot exceed 24 hours, so I need a way to change the data type to [HH]:MM:SS. If that's possible?


    Again, I can't attach any sample data so any advice is appreciated.
    Last edited by Jake_; 12-09-2021 at 12:01 PM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Query - Operator Error

    Can you post the M code?
    Rory

  3. #3
    Registered User
    Join Date
    12-09-2021
    Location
    Stroud
    MS-Off Ver
    365
    Posts
    9

    Re: Query - Operator Error

    Yeah here you go:

    let
    Source = AgentStatus_grouped,
    #"Filtered Rows" = Table.SelectRows(Source, each [EventName] = "Call Wrap" or [EventName] = "Ready" or [EventName] = "Ready,Ready (Offline)_001" or [EventName] = "Ready,Ready (Offline)_Phone Connected" or [EventName] = "Ready,Ready (Offline)_Phone Ringing" or [EventName] = "Ready,Ready (Offline)_Phone Wrap" or [EventName] = "Ready_Phone Connected" or [EventName] = "Ready_Phone Ringing" or [EventName] = "Ready_Phone Unexpected"),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"EmployeeLastName", "EmployeeFirstName", "FullName", "AgentID", "EmployeeTeam", "Date"}, {{"TimeInStatus", each List.Sum([TimeInStatus]), type nullable time}})
    in
    #"Grouped Rows"

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Power Query - Operator Error

    The problem is simply that you can't add time values. You'd need to change the column type to decimal numbers, sum it, then change it back to date/time (in case it goes over 24 hours) and then deal with it as need be. You could also just leave it as decimal and work with that.

  5. #5
    Registered User
    Join Date
    12-09-2021
    Location
    Stroud
    MS-Off Ver
    365
    Posts
    9

    Re: Power Query - Operator Error

    That's bril, thanks rorya!

+ 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. [SOLVED] power query error: we cannot apply operator - to types text and number
    By loganpmgoa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-14-2019, 01:44 PM
  2. [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
  3. Syntaxt Error (missing operator) in query expression!
    By jdgwebdev in forum Access Tables & Databases
    Replies: 3
    Last Post: 02-25-2013, 09:32 AM
  4. Help with query using paramter and like operator
    By sumdumgai in forum Excel General
    Replies: 0
    Last Post: 09-19-2012, 10:41 PM
  5. 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
  6. Use of LIKE operator in a query asking for an input
    By Romoluzzi in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-08-2011, 08:48 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