Jump to content
Changes to the Jaspersoft community edition download ×

Filter by metric does not work


carolinapj

Recommended Posts

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 SQL

select `Nombre conductor`,sum(`Numero partes`) from wtoc
where `Fecha` between timestamp('2020-05-01 00:00:00') and timestamp('2020-05-31 00:00:00')
and `Numero partes` > 100
group by `Nombre conductor`

And I need something like this:

select `Nombre conductor`,sum(`Numero partes`) from wtoc
where `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?

captura.png.f1bb27ec052ca9b4aaae8419857668c7.png

 

Thanks!

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...