Sum of similar items

Hi Good day!

 

I am stuck on my app, can someone help me maybe you guys know how to do this on appsheet. 

I have a sample database, I want to see the total number of alike items. Sample given below on how the view should look like, 

Sample Database:

ItemQty
Apple2
Orange3
Apple4
Orange5

Target View:

ItemQty
Apple6
Orange8

Please help me what formulas I can use for this and also how to do it. 

 

Thank you!

Solved Solved
0 4 164
2 ACCEPTED SOLUTIONS

 

Create another sheet and connect it in the app. The values would be the unique values from your sample dataset. See sample table below.

 

ItemQty (use this column if you will use SUMIFS() inside Google Sheets)
Apple 
Orange 

 

If you will use virtual column, the formula would be:

SUM(
	SELECT(
		Table[Qty],
		[Item] = [_THISROW].[Item]
	)
)

 

View solution in original post

I agree with @SkrOYC that you'd better use UX views to group items and dynamically display the corresponding sum; to avoid impacting your app's performance.

If however, you still want to generate your "Target View", you can do the following:

  1. Create a slice with the following expression as the slice's row filter condition:

    [_RowNumber] = MIN(  SELECT(Table[_RowNumber], [Item] = [_ThisRow].[Item]) )

  2. Add a virtual column with the following app formula:

    SUM( SELECT(Table[Qty], [Item] = [_ThisRow].[Item]) )

  3. Create a new view and for your slice. 

View solution in original post

4 REPLIES 4

 

Create another sheet and connect it in the app. The values would be the unique values from your sample dataset. See sample table below.

 

ItemQty (use this column if you will use SUMIFS() inside Google Sheets)
Apple 
Orange 

 

If you will use virtual column, the formula would be:

SUM(
	SELECT(
		Table[Qty],
		[Item] = [_THISROW].[Item]
	)
)

 

There is no way on AppSheet at the moment that I know of to make a summary dinamically.

Now, you could have a group by where the group is the Item and aggregate by Sum:: Qty.

It's the best solution from the stock UI options.

Anything else would require a workaround

I agree with @SkrOYC that you'd better use UX views to group items and dynamically display the corresponding sum; to avoid impacting your app's performance.

If however, you still want to generate your "Target View", you can do the following:

  1. Create a slice with the following expression as the slice's row filter condition:

    [_RowNumber] = MIN(  SELECT(Table[_RowNumber], [Item] = [_ThisRow].[Item]) )

  2. Add a virtual column with the following app formula:

    SUM( SELECT(Table[Qty], [Item] = [_ThisRow].[Item]) )

  3. Create a new view and for your slice. 
Top Labels in this Space