When do I use + and when do I use SUM(LIST()) ?
Is one more efficent over the other or is it equivalent?
When do I use + and when do I use SUM(LIST()) ?
Is one more efficent over the other or is it equivalent?
My understanding:
When adding the individual columns of either of number, decimal or price type you could use +
For example, if you have [Initial Quantity] and [Added Quantity], each as number type columns, you could do [Initial Quantity]+ [Added Quantity]. As long as those individual columns evaluate to a number or price or decimal type you could use +
The above can also be computed as SUM(LIST([Initial Quantity], [Added Quantity])) but mostly one will prefer just to add those individual columns with a +
So you could even do ANY(Some Table[Quantity]) + ANY(Other Table[ Another Quantity]) because ANY() extracts a single value from the list.
Alternatively, if you get/ retrieve a combined list of number, decimal or price type several values through say a SELECT() statement, to add those elements in the list, you could use SUM(SELECT(β¦))
Edit: Added some more description.
[Col1]+[Col2]+[Col3] on a VC called like "[Sum]"
SUM(Dataset[Column]) on a VC called like "[Sum]"
Dataset[Sum]
SUM(Dataset[Column])+SUM(Dataset[OtherOne])
In general use SUM() if there is a list which may have an unknown number of items and β+β when you want to make basic additions of a fixed number of fields
@SkrOYC @Suvrutt_Gurjar Thank you
Please note that β+β is also used in AppSheet as a list addition operator.