Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5028

Count virtual aggregate based on time window in API docs

$
0
0

I figured out the solution. This is how to add a virtual aggregate field to get a "This Week" column to only count records from the last 7 days.

Add field, type = virtual

DB Function =
Count_BIG(CASE WHEN DateField > GETDATE() - 8 THEN 1 ELSE NULL END)

check the "aggregate DB Function?" box.

It's actually more efficient to do this math in DreamFactory than in the sql.


Viewing all articles
Browse latest Browse all 5028

Trending Articles