Use case : to display the highest value of different groups

Dear all,
I’m looking for displaying only the greatest value by groups (here group = building reference). In the present example, I expect to display in a dashboard the last versions of the data so:
56s-Peres75006 -------------- 4 ------- < 1500
25nnequin75017 -------------- 1 ------- < 1500
987oincarre60280 -------------- 1 ------- < 1500
Etc…

image

I sorted my data by classifying both building reference and version but I’m npw blocked in displaying the correct view.

Really hope that you can help,
Many thanks !

After “Search for Building (POR)s” click “more…” and select Group by and then select a field for grouping (build ref in your case) and Max for aggregation function.

Thanks for your answer that seems very logical. I did this, but this is no value displayed in the RG, maybe I did something wrong ?

Maybe worth to mention that I have other fields and that may be the reason why the grouping may not work here ?

My need is for displaying last data (last version) in a dashboard and therefore to select data in the database

Someone can help with this ?

You’d then make a text element or similar in the repeating group, and the dynamic data would be something like “current cell’s grouping’s aggregation max”.

Not sure to get it, would you mind giving me an example ?

It would be like this, except instead of “count” you would choose “max”.

As long as the text element is inside the repeating group it should appear.

It does not work because I only want to display the line with the highest value in a sub group (ex. version 3 of a specific building). As, I may have differents changes in the line (ex. altitude, …) the grouping does not work in this case.

Can you use conditionals to make it so each row is “not visible” if “current cell’s _____ does not equal current cell’s grouping’s max”?

Try this:

  1. Group your Building (POR) RG’s search by 00_BuildRef with max of 00_BuildingVers as an aggregation.

  2. Put a group in your RG with a content type of Building (POR) and data source of search for Building (POR) ==> constraints: 00_BuildRef = current cell’s grouping’s 00_BuildRef AND 00_BuildingVers = current cell’s max of 00_BuildingVers; sorting = creation date (descending = yes). Be sure to add first item to the data source expression.

  3. Put text boxes in the group for the various fields you want to display for the item.

I’m not sure that this is the most efficient way to do this but I can’t immediately think of a better way without perhaps having to resort to list-management plugins.

Thank you, this is brilliant !
If I may :slight_smile: : it generates a new problem as I would like to display data in a popup (previously it was easy as it was "current’s cell Building (POR) ")

You’re welcome. If you place your icon in the group created in my step 2 above then you should be able to change the expression to Parent group’s Building (POR).

This topic was automatically closed after 70 days. New replies are no longer allowed.