Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AIShatiLove
Contributor III
Contributor III

sum by conditions

I want to remove unnecessary rows in the summation of the column, so i also have two conditions to remove this lines, for exmp,  i want to sum all money in column Money, but i should exclude values that in column "Country" start with "B*" and in column "City "  start with "New*"

i tried using it with wildmatch  and if:

sum( if( wildmatch (Country,'B*')  and  wildmatch (City,'new*'), null(), [Money] )

but it doesn't work correctly

                                         

Labels (1)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Actually, after rereading your post, I realize that I missed the fact you are trying to exclude those rows.

If you want exclude rows that meet your criteria, add - before the = in your set analysis. 

sum({$<Country-={"B*"},City-={"new*"}>} Money)

View solution in original post

3 Replies
GaryGiles
Specialist
Specialist

Try this:

sum({$<Country={"B*"},City={"new*"}>} Money)

GaryGiles
Specialist
Specialist

Actually, after rereading your post, I realize that I missed the fact you are trying to exclude those rows.

If you want exclude rows that meet your criteria, add - before the = in your set analysis. 

sum({$<Country-={"B*"},City-={"new*"}>} Money)

AIShatiLove
Contributor III
Contributor III
Author

Thanks, now i understand