Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
=iif(Fields!Type6.Value="S","",Sum(Fields!Col6.Value))

this is my expression which i use for a Sum of collum which dont Contains "S"

What I have tried:

this Expression return #Error
iif(Fields!Type6.Value="S","",Sum(Fields!Col6.Value))

This Works Fine But it will sum up also alphanumeric column numeric characters
iif(Fields!Type6.Value="S","",Val(Sum(Fields!Col6.Value)))


i have used dynamic column so i dont know which is numeric column or string
so plz help me to out from this
Posted
Updated 19-Dec-19 3:00am

1 solution

Try:
=Sum(IIf(Fields!Type6.Value="S", 0, Val(Fields!Col6.Value)))
 
Share this answer
 
v2
Comments
Praful Karkar 19-Dec-19 23:16pm    
it works perfect but
=Sum(IIf(Fields!Type6.Value="S", 0, Val(Fields!Col6.Value)))
if my Type6="S" then it also returns me to sum of column
i cant understand because if my column is Type6="S" then it must return 0
and i dont need 0 plz i need a nothing



when i pass like this
=Sum(IIf(Fields!Type6.Value="S", "", Fields!Col6.Value))
i removed Val Because Col6 is my Alphanumeic column
so i dont want to sum it
it gives #Error
Richard Deeming 20-Dec-19 7:39am    
What do you think the sum of 42 + "" should be?

If "" is not the same as 0, then there's no valid answer.
Praful Karkar 20-Dec-19 23:22pm    
if there is a way please suggest me it's important to return "" if false
Richard Deeming 7-Jan-20 13:55pm    
Once again: what is the sum of 42 + ""?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900