Here’s an expression to sum monthly expenditure amount of people based on a few criteria:
sum(
select(
User expense submissions[Amount],
AND(
(month([Date]&year([Date])=month(today())&year(today())), //for 31/3/2020, the expression is 32020
([User]=[_THISROW].[Name]), //The column that holds the current user name
([Indirect?] = “FALSE”) //just another yes/no condition checked
)
)
)
I don’t know why it is summing to 0.
I know this is the last day of the month and time zones may differ, so I have also tried using (month(today())-1)&year(today()). Still a zero.
Maybe the (month([Date]&year([Date]) is taking text values instead of number? The description in the space below where the expression is entered does say “Concatenation of text values”.
If that’s so, I don’t have any way to change it to a number type.
Solved! Go to Solution.
I have solved this. The trick was to use the number() function around the (month()&year()) function that converts the string to a number, had it taken a text value by the concatenate() function.
Missing parenthesis to close the first call to MONTH().
It was a typo here. In the app itself, the expression is correct in parentheses.
If the number of parentheses don’t equal, the the expression is rendered incorrect, isn’t it?
I have solved this. The trick was to use the number() function around the (month()&year()) function that converts the string to a number, had it taken a text value by the concatenate() function.
User | Count |
---|---|
17 | |
9 | |
6 | |
5 | |
5 |