Replies: 2 comments
-
Hey, we know that filters could be more flexible, but the For example, if your User schema has an @impl Backpex.LiveResource
def metrics do
[
active_subscription_count: %{
module: Backpex.Metrics.Value,
label: "Active Subscription Users",
class: "lg:w-1/4",
select: dynamic([u], count(fragment("CASE WHEN ? = TRUE THEN 1 ELSE NULL END", u.active_subscription))),
format: fn value ->
Integer.to_string(value)
end
}
]
end I added a metric that shows the number of published posts in our demo application to see it in action: #561 (not released yet) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ah that was the missing puzzle piece for me. Thanks for your answer again :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
is it possible to filter a query for a metric? For example: Display the amount of users with active subscriptions etc.
Beta Was this translation helpful? Give feedback.
All reactions