Hi team, I have a question on a metric. I need to ...
# gooddata-cloud
a
Hi team, I have a question on a metric. I need to get the previous day’s value, but I only have weekday data. That means that I can get the previous day’s data for Tuesday-Friday, but every Monday result is empty, since I don’t have Saturday or Sunday data. Is there a way to do something like (for previous data that exists) so my metric doesn’t break every Monday? I basically need Monday’s result to pull the previous Friday’s data. I’ve tried everything I can think of, including case when, ifnull, datetime_diff, previous(date,-1) etc. Any ideas?
m
Hi Andy, if you don't have any data on these days, then I would suggest using a metric such as: SELECT SUM(fact) WHERE Day of Week (Mon-Sun) (Date) NOT IN (Sat,Sun) Note that the syntax above is for our Platform product, therefore I would recommend double checking it to avoid any errors.
a
Thanks! I will try that