
Robert Rafferty
Member
Members

Forum Posts: 35
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: 4619
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: Philip Treacy, Ted Eggleston
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
Hans Hallebeek: 185
Newest Members:
thong nguyen
Appiagyei Kofi Frimpong
Hilary Burchfield
Richie Wright
Adel Kock
Barbara Murray
Doug Milne
Siobhan Stringer
Rob Rooth
Tom Lewis
Forum Stats:
Groups: 3
Forums: 24
Topics: 6542
Posts: 28644
Member Stats:
Guest Posters: 49
Members: 32830
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —
