
Robert Rafferty
Member
Members

Forum Posts: 32
Member Since:
September 15, 2020
September 15, 2020

I am getting an error when I try to build out a conditional column to provide a time based on day.
For example, if day of week equals 0 (Sunday) or 6 (Saturday) make time 8:00 PM, otherwise 2-5 make time 10:00 PM
the column returns the literal #time(22,0,0)
Driving me crazy, can you help figure out the issue?
Thanks
Robb

Mynda Treacy
Admin

Forum Posts: 4447
Member Since:
July 16, 2010
July 16, 2010

Hi Robb,
Thanks for the file. Click on the last step in the query editor > go to the formula bar and remove the double quotes around the #time(... formulas, so that it looks like this:
= Table.AddColumn(#"Changed Type1", "store close", each if [In Day of Week] = 6 then #time(20, 0, 0) else if [In Day of Week] = 0 then #time(20, 0, 0) else #time(22, 0, 0))
Then change the data type to Time.
Mynda

Answers Post
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Roslyn Finlayson, s Ramchandran, Shanna Henseler, LAN H
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6210
Posts: 27236
Member Stats:
Guest Posters: 49
Members: 31888
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —
