GROUP BY in Slices

Hello,

please i need help.

How can I create a view or slices that show me data records  in similar solution as in SQL?

"SELECT DISPOSITIVO, MAX(DATA) AS DATAMAX

FORM MOV

GROUP BY DISPOSITIVO"

Thank you

Solved Solved
0 10 232
1 ACCEPTED SOLUTION

Yes, sorry.  I forgot MAXROW provides filtering capabilities.  The expression should be like this:

IN([ID], LIST(MAXROW("MOVIMENTI", "Data", [IDDISPOSITIVO] = [_THISROW].[IDDISPOSITIVO])))

View solution in original post

10 REPLIES 10

Grouping cannot be accomplished in Slices. 

Table views and Deck views have aggregate functions (a.k.a Grouping functions) that can be used in the view itself to apply visual Grouping to your data.  These aggregates could Sum, Average, Count, etc...and yes MAX is one of the functions.  See image below.

If you have some other usage for the MAX values, please explain your need and we can help find a way to accomplish it in AppSheet.

Using MAX value in GroupingUsing MAX value in Grouping

 Thank you for you answer. 

In My AppSheet, in Group aggreagate I have only COUNT. You can see the immage. 

I need aggreagate by data max. Is it possible?

Thank you. 

 

 

Schermata 2022-01-26 alle 22.14.22.png

What is the data type of "IDDISPOSITIVO"?

Hi, and Thank you for you answer.

It is REF. You can see :Schermata 2022-01-26 alle 22.34.56.png

 

I see now, I thought you were showing some psuedo-data.

You want to Group By one column but show the MAX of another column.

No, this is not possible in AppSheet with out-of-the-box capabilities.

If you could describe how you would use this, there might be another approach that would allow you to achieve the same goal.

 

In screenshot you can see the table. 

I need a view where the record table "MOVIMENTI" are group by [IDDISPOSITIVO] where [DATA] value is Max. 

Can you help me, please. Thank you very much. 

 

Schermata 2022-01-26 alle 22.47.26.png

Ok, got it.  Try this expression below.  I have not tested it.  Let me know if you have trouble.

IN([ID], LIST(MAXROW(FILTER("MOVIMENTI", [IDDISPOSITIVO] = [_THISROW].[IDDISPOSITIVO]), "Data")))

Thank you for you answer. It doesn't work.

Please yuo can see the image. Thank you. 

1.jpg

Yes, sorry.  I forgot MAXROW provides filtering capabilities.  The expression should be like this:

IN([ID], LIST(MAXROW("MOVIMENTI", "Data", [IDDISPOSITIVO] = [_THISROW].[IDDISPOSITIVO])))

Perfect. It works very well. Thank you very much for your help. 

Great. Now I will try study your expression. 

Top Labels in this Space