2 of 2 people found this helpful
Could you please tell me the Data type of [Amount] field??
I'm assuming its a numeric field as per the naming convention.
Now come to your first case statement, If the condition ([Subcategory] = "aaa") matches then only you'll get the amount of that subcategory(aaa).
Your second case is also doing the same but you're trying to convert the data type of resulted[Amount] of Subcategory(aaa) to integer. If the [Amount] field is already a numeric field then you'll get a data type conversion error.
Hope you get my point.