9.Daily Revenue 2: refunded_at is null


#1

The instructions say to exclude the results that have a refunded_at value of null. I did that, but I got the error message "Sum daily revenue without refunds.".

Here's my code:

select
  date(created_at),
  round(sum(price), 2) as daily_rev
from purchases
where refunded_at is null
group by 1
order by 1;

If I click "Get Code" when it pops up, it puts in a query that looks like exactly the opposite of what the instructions say to do, excluding the records that have a value in refunded_at:

select
  date(created_at),
  round(sum(price), 2) as daily_rev
from purchases
where refunded_at is not null
group by 1
order by 1;

Am I missing something here, or is the parser grading it backwards?


Daily Revenue 2: Incorrect Solution
#2

Hey @vaggrippino,

yes, you are right: it's a bug.


#3

Thank you, I thought I was going crazy.


#4

Yes. If you think critically about the exercise (which many folks may not, they may just troll for the right answer), it doesn't make sense.


#5

Still the same issue present with this exercise - you are told to exclude the refunds, but are required to filter to only refunds.


#6

Glad I wasn't the only one wondering about this.
The bug is still there.


#7

Yep, I sat here some time going over and over my logic, but this is definitely wrong. I'm glad others found the same thing so I know I'm not crazy too. Has it been reported as a bug? Even if so, I'm going to report it again - maybe the more who report it, the more likely it'll be fixed more quickly?


#8

I just submitted another bug report for this issue.


#10

I felt like an idiot too :wink:


#11

Feel a lot better that I am not the only one who was driven nuts by this bug!


#12

TO continue you can use where refunded_at='null'. BOTH are one and the same but it might be a bug.


#15