Hello gurus,
I have this view-entity which I use to see how many times a "centroEnsayo" is referenced in "SeguimientoCentro" <view-entity entity-name="ParticipacionCentros" package-name="org.ofbiz.bdmetrics"> <member-entity entity-alias="SG" entity-name="SeguimientoCentro"></member-entity> <alias name="centro" group-by="true" field="centroEnsayo" entity-alias="SG"></alias> <!-- count-distinct just in case --> <alias name="participacion" function="count-distinct" field="idSeguimientoCentro" entity-alias="SG"></alias> </view-entity> I have to get the 30 most active "centroEnsayo" (those which participacion is higher), so I should order the query so the most active is first. I am using minilang and I tried: <entity-condition list-name="listaCentros" entity-name="ParticipacionCentros"> <select-field field-name="centro"/> <select-field field-name="participacion"/> <order-by field-name="participacion"/> <limit-range size="30" start="1"/> </entity-condition> but of course, this just orders the list so the less active is first. Any ideas? Thanks, -- ------------------------------------------------------------------------ Soluciones de Gestión para su empresa eBusiness, ERP, CRM ------------------------------------------------------------------------ *Daniel Martínez Martínez* * * Director de Proyectos C/ Julia García Boután, 29 D 3ºB 28022 Madrid España * * E-mail: [hidden email] <mailto:[hidden email]> Web: *www.paradisosistemas.es <http://www.paradisosistemas.es> *Comercial: [hidden email] <mailto:[hidden email]> Tel: 678416758 |
Just change: > <order-by field-name="participacion"/> to: > <order-by field-name="-participacion"/> -David On Feb 15, 2007, at 11:25 AM, Daniel Martínez wrote: > Hello gurus, > > I have this view-entity which I use to see how many times a > "centroEnsayo" is referenced in "SeguimientoCentro" > > <view-entity entity-name="ParticipacionCentros" > package-name="org.ofbiz.bdmetrics"> > <member-entity entity-alias="SG" > entity-name="SeguimientoCentro"></member-entity> > <alias name="centro" group-by="true" field="centroEnsayo" > entity-alias="SG"></alias> > <!-- count-distinct just in case --> > <alias name="participacion" function="count-distinct" > field="idSeguimientoCentro" entity-alias="SG"></alias> > </view-entity> > > I have to get the 30 most active "centroEnsayo" (those which > participacion is higher), so I should order the query so the most > active > is first. > > I am using minilang and I tried: > > <entity-condition list-name="listaCentros" > entity-name="ParticipacionCentros"> > <select-field field-name="centro"/> > <select-field field-name="participacion"/> > <order-by field-name="participacion"/> > <limit-range size="30" start="1"/> > </entity-condition> > > but of course, this just orders the list so the less active is first. > > Any ideas? > > Thanks, > -- > ---------------------------------------------------------------------- > -- > Soluciones de Gestión para su empresa > eBusiness, ERP, CRM > ---------------------------------------------------------------------- > -- > *Daniel Martínez Martínez* > * * > Director de Proyectos > C/ Julia García Boután, 29 D 3ºB > 28022 Madrid > España * * > E-mail: [hidden email] > <mailto:[hidden email]> > Web: *www.paradisosistemas.es <http://www.paradisosistemas.es> > *Comercial: [hidden email] <mailto:[hidden email]> > Tel: 678416758 > > smime.p7s (3K) Download Attachment |
Free forum by Nabble | Edit this page |