Hi all,
i have a sheet on excel with 5 rows that, for each rows, sum some value from sheet 1 using some condition. Values are prices
Below an example of the formula iโm using on excel:
=SUMIFS(Expense!D:D;Expense!C:C;โAโ;Expense!F:F;โYesโ)
=SUMIFS(Expense!D:D;Expense!C:C;โBโ;Expense!F:F;โYesโ)
=SUMIFS(Expense!D:D;Expense!C:C;โCโ;Expense!F:F;โYesโ)
=SUMIFS(Expense!D:D;Expense!C:C;โDโ;Expense!F:F;โYesโ)
=SUMIFS(Expense!D:D;Expense!C:C;โEโ;Expense!F:F;โYesโ)
the last row is the sum of the previous.
On AppSheet the value is not correctly shown. I have the text #VALUE! when i try to show the cell value on a table.
How can i fix this solution?
Thanks in advance!
Solved! Go to Solution.
Try:
sum(select(Expense[Quantity], and([Hype?] = โYesโ , [Created By] = โAโ)))
or to match whomever Who refers to:
sum(select(Expense[Quantity], and([Hype?] = โYesโ , [Created By] = [_thisrow].[Who])))
I m not Excel expert, but why you donโt run the same calculation within Appsheet virtual column? I think it should be much easier and run app faster as well.
Thank you Tsuji.
How can i create the same calculation within Appsheet virtual column?
Is it possible to sum value from different table?
I suggest you create a super simple table only one column called [ID].
And then you manually add value to this fields. Values are
A
B
C
D
E
Now you have 5 rows.
Then on this table create the virtual column with expression something like this.
Ifs(
[ID]=โAโ, sum(select(TargetTableNameYouHaveNumber[TargetNumericField], ANYCONDITIONYOUNEEDTOFILTERROS)),
[ID]=โBโ, sum(select(TargetTableNameYouHaveNumber[TargetNumericField], ANYCONDITIONYOUNEEDTOFILTERROS)),
[ID]=โCโ, sum(select(TargetTableNameYouHaveNumber[TargetNumericField], ANYCONDITIONYOUNEEDTOFILTERROS)),
[ID]=โDโ, sum(select(TargetTableNameYouHaveNumber[TargetNumericField], ANYCONDITIONYOUNEEDTOFILTERROS)),
[ID]=โEโ, sum(select(TargetTableNameYouHaveNumber[TargetNumericField], ANYCONDITIONYOUNEEDTOFILTERROS)),
)
You can use switch expression, but the result is the same.
This new table is kinds of summary table where you see the result of calculations, but it always run the calculation dynamically.
This should definitely make app run faster rather than letting excel or spreadsheet do the same jobs.
Iโm trying with only one if:
IF([Who]=โAโ, sum(select(Expense[Quantity], Expense[Hype?] = โYesโ)))
but the result is the error:
Cannot compare List with Text in (Expense[Hype?] = โYesโ)
Try:
IFS([Who]=โAโ, sum(select(Expense[Quantity], [Hype?] = โYesโ)))
Now i have no error, but the result of the sum is 0.
Is it maybe because [Hype?] is in a different table? Expense in that case.
Unfortunately, if i use Expense[Hype?] = โYesโ
i have the error Cannot compare List with Text in (Expense[Hype?] = โYesโ)
Within a SELECT() expression, bare column value references are assumed to refer to columns in the table being searched. So in select(Expense[Quantity], [Hype?] = โYesโ)
, the table being searched is Expense and the bare column value reference [Hype?]
is assumed to mean the Hype? column in the Expense table.
understood. But i still receive 0 as a result.
Also, i need to apply a second filter in Expense table. How can i perform this?
That suggests one or more of the following:
The value of the Who column is not A
.
There are no rows in the Expense table with a Hype? column value of Yes
.
The Quantity column values of the matching rows are all zero.
The column receiving the result is type Number but the Quantity values are type Decimal and add up to less than 1.0.
One problem at a time.
Here the issue: i have quantity as Price and the result type Price. I changed both in Decimal and now the sum is correct, but i lose the currency.
EDIT: i swithced back to Price and now itโs working! Now i need only to apply a second filter to SELECT() function
Ugh! Not the first time Iโve seen that type of glitchโฆ Glad itโs working now!
Tell me more. You might also find this useful:
Thanks for your help!
I need to sum quantity based on [hype?] = โYesโ but also on a different column value, which is Expense.[Created By]. Something like:
IFS([Who]=โAโ, sum(select(Expense[Quantity], [Hype?] = โYesโ, [Created By] = โAโ)))
Try:
sum(select(Expense[Quantity], and([Hype?] = โYesโ , [Created By] = โAโ)))
or to match whomever Who refers to:
sum(select(Expense[Quantity], and([Hype?] = โYesโ , [Created By] = [_thisrow].[Who])))
It Works!
Thank you so much Steve!
User | Count |
---|---|
16 | |
11 | |
9 | |
8 | |
4 |