Hi
I was helped by @Steve and he helped me write the expression to Filter data by Start date and End Date. I now have the data filtered as below
IN( [Date], SELECT(Meter [Date], AND( [Date]>=ANY(DateFilter[Start Date]), [Date] <=ANY(DateFilter[End Date]))))
Now I have Meter data (more than one meter) and there are 3 columns Meter[Oil], Meter[Water] and Meter[Gas] that I want to Aggregate or SUM for the chosen dates and only want Unique reading (1 reading) per Meter
How do I achieve this?
Thanks
Amol
Hi @ABBA!
Do you understand the expression that @Steve helped you with? Hereโs how I understand it:
First, in the middle, you have an expression that gives you a list of all of the meter dates between the โStart Dateโ and the โEnd Dateโ:
SELECT(Meter [Date], AND(
[Date]>=ANY(DateFilter[Start Date]),
[Date] <=ANY(DateFilter[End Date])))
For more information see
You mentioned that you donโt want duplicates. Hereโs an example from the SELECT() article:
SELECT(Students[First Name], ([Class of] = "2020"), TRUE)
: A list of distinct first names (duplicates omitted) of the students of the class of 2020.
Then, the expression checks to see if the date of this record is in that list:
IN( [Date],
SELECT(Meter [Date], AND(
[Date]>=ANY(DateFilter[Start Date]),
[Date] <=ANY(DateFilter[End Date])))
)
See
Now what you want to do is sum lists. There first step is the same; make a list expression to find everything you want to sum up. Then, you want to put that inside a sum() expression. Look at
By the way, it seems that omitting duplicates is the default.
To make a long story short, I think that all you will need to do is replace the IN() expression with a SUM() expression and change the names of columns as needed.
Is this enough to help?
I tied what you mentioned. But gave me an error in expression.
I want to sum the Filtered Data. Currently, I get the Data Filtered between Start Date and End Date. Please see attached
Hi @ABBA,
If I have correctly understood your requirement, you may wish to try the following approach. Please note that the approach uses virtual columns to compute various aggregations you wish to have. Also due to inherent nature of aggregation functions that span over many rows, these VCs may have adverse impact on your app sync times.
SUM(SELECT(Meter [Oil-Bbls], AND( [Date]>=ANY(DateFilter[Start Date]), [Date] <=ANY(DateFilter[End Date], [Meter Name]=[_THISROW].[Meter Name])))))
The above expressions will sum the [Oil-Bbls] for the selected date range and for each meter.
The filter expression for this slice may be something like
IN([Date], LIST(MAX(SELECT(Meter [Date], AND( [Date]>=ANY(DateFilter[Start Date]), [Date] <=ANY(DateFilter[End Date], [Meter Name]=[_THISROW].[Meter Name]) ))))
The slice expression will filter the row with the maximum date for each meter and the VCs described in 1) above in that row will show the respective aggregated values.
SUM(SELECT(Meter [Oil-Bbls], AND( [Date]>=ANY(DateFilter[Start Date]), [Date] <=ANY(DateFilter[End Date], [Meter Name]=[_THISROW].[Meter Name])))))
HELLO, @Suvrutt_Gurjar I TRIED USING THIS FORMULA IN VCโS BUT IT SHOWS ANY FUNCTION USED INCORRECTLY , CAN YOU PLEASE CHECK WHAT IS WRONG WITH THIS FORMULA
Thank you so much @Suvrutt_Gurjar Sir
I appreciate your help.
I can create a new sheet in Google Sheet and have columns that shows the SUM numbers
Is it possible?
Thanks
Amol
hI @ABBA,
I believe in general it should be possible. You may aggregate using the SUMIF() Google sheet formulas in the same Meter table or a different table.
However please note that as per my understanding the aggregated values from spreadsheet formula will reflect in respective individual records in the app only after the record is opened and closed.
So my suggestion will be to start with small test data and one aggregation field and test it out whether it meets your requirement.
User | Count |
---|---|
41 | |
36 | |
28 | |
23 | |
16 |