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: 4703
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: Anders Sehlstedt
Guest(s) 11
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1917
SunnyKow: 1432
Anders Sehlstedt: 900
Purfleet: 414
Frans Visser: 346
David_Ng: 306
Hans Hallebeek: 290
lea cohen: 246
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Stephen Keating
David M Connelly
Quick Analytics
Peter Craven
Thomas Huybs
Cassandra McGuire
Leo Bonaparte
Excel Learner
david gavi
Rick KISA
Forum Stats:
Groups: 3
Forums: 24
Topics: 6880
Posts: 30159
Member Stats:
Guest Posters: 49
Members: 33707
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —