Robert Rafferty
Member
Members
Forum Posts: 39
Member Since:
September 15, 2020
September 15, 2020
Offline
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: 4784
Member Since:
July 16, 2010
July 16, 2010
Offline
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:
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1945
SunnyKow: 1432
Anders Sehlstedt: 959
Purfleet: 415
Hans Hallebeek: 377
Frans Visser: 351
David_Ng: 318
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Jennifer Hull
kris king
Hasanul Karim
Terrie s
Jack Ennis
Gary Day
Michael Wiliams
Jim Collier
Allan Chan
Rik Lelliott
Forum Stats:
Groups: 3
Forums: 25
Topics: 7159
Posts: 31414
Member Stats:
Guest Posters: 50
Members: 34674
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —