I want this to be showing the most relevant, "current week", every time I look at the dashboard, as time moves on.
The normal way to do this would be to set the default value for {{week}} as "current_date()" (or some variation). However, it looks like I can only set {{week}}'s default to a static date, which isn't the most useful.
If you were trying to do something like this in a data warehouse, you’d just create a date table and update it daily (easy enough).
Table would have columns of date, month, year, day of week. isLastWeek, isThisWeek, isYesterday, quarter etc etc
Contains dates for the last n years where n depends upon your data.
So that the date (if provided, or if today) always flattens to that week’s Monday date.
I should add for future readers that this only works if you ensure that {{week}} is not a required parameter (the UI makes it quite confusing to establish that this is the case).
Hi,
I’m using mongodb so I need the query equivalent of this:
" select count(*) from products where {{category}} “.
I don’t even know if it’s possible or not.
I tried this one :
{
“$group”:{”_id":{“stage”:"$stage",“project”:"$projectName"},
“count”:{"$sum":1}
}
},{"$unwind":"$_id"},{ “$project” : {
“_id”:0, “stage”:"$_id.stage",“project”:"$_id.project",“count”:1
}},{"$match":{“project”:"$$category"}}
But it didn’t work.
@omerfaruk But which column is this supposed to check against? cast(getDate() As Date)
Here’s what you do. Remove the Optional Clause. Make sure that the query works as expected and then add the Optional Clause back.
Providing the real query is much easier, since your example would never have worked.
I would guess you’re trying to do this:
select * from Mytable
where 1=1 AND cast(tarih as date) = [[{{datevar}} --]] cast(getDate() As Date)