carolinapj Posted September 23, 2020 Share Posted September 23, 2020 Hi!I have an ad-hoc view with a simple table with Drivers and Number of services in a period of time.The number of services is a metric calculated as the Sum of a field. In database the field is always 1.The problem comes when filtering by that metric, because the SQL generated is filtering by the field and not by the sum of the field. So, if we put in the filter any value diferent from 1, the report displays no data.This is the SQLselect `Nombre conductor`,sum(`Numero partes`) from wtocwhere `Fecha` between timestamp('2020-05-01 00:00:00') and timestamp('2020-05-31 00:00:00')and `Numero partes` > 100group by `Nombre conductor`And I need something like this:select `Nombre conductor`,sum(`Numero partes`) from wtocwhere `Fecha` between timestamp('2020-05-01 00:00:00') and timestamp('2020-05-31 00:00:00')group by `Nombre conductor`having sum(`Numero partes`) > 100¿Could anybody help me? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now