Can you post your sample data and the a general description of what you are trying to calculate? There might be a better or easier way.
I have solved this already , here is my answer and description:
What i was actually trying to do was to count how many Items had one kind of classification (RT) in an excel file, so i had a file with several columns , classification was one of the columns. in short, i wanted to count the number of items that had RT classification for every factory in the excel doc. i did the following:
COUNT(IF(CONTAINS([Tipo],'RT'))THEN 1 ELSE NULL END)
I just droped that in the view and it worked fine, thanks.