[Cubicweb] Complex RQL request

Stéphane Bugat stephane.bugat at free.fr
Thu May 31 10:35:07 CEST 2012


Hi all

In our CW-based application, TERESA, I'm trying to elaborate a RQL request to sort the number of resolved incidents during the last month per application and per incident type ('blocking', 'major' and so on).
My request is :

Any A,NA,NB WHERE A identity B
WITH A,NA BEING (Any C,SUM(F) GROUPBY C WHERE C is Application, C has_incident D, D gravite E, D nb_incidents_meme_nature F, D date_fin DF HAVING (E='majeur' AND MONTH(DF)=(MONTH(today)-1))),
     B,NB BEING (Any C,SUM(F) GROUPBY C WHERE C is Application, C has_incident D, D gravite E, D nb_incidents_meme_nature F, D date_fin DF HAVING (E='bloquant' AND MONTH(DF)=(MONTH(today)-1)))

The problem is that only applications having 'blocking' and 'major' incidents the same month are displayed. I have tried to add an "?" card to the has_incident relation but it doesn't work neither.
Any idea about that?

Thanks in advance

Stephane


More information about the Cubicweb mailing list