This is a migrated thread and some comments may be shown as answers.

Count with condition

2 Answers 171 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel Botero Correa
Top achievements
Rank 1
Daniel Botero Correa asked on 22 Apr 2010, 03:17 PM
Hello,

I'm searching how can i count with a condition, For example:

GROUP 1 
       NUMBER 
       1 
       0 
       1 
       0 
       0 
       Total 0 = 3/ Total 1 = 2 
GROUP 2 
      NUMBER 
       1 
       1 
       1 
       0 
       0 
       Total 0 = 2/ Total 1 = 3 
TOTAL GROUPS Total 0 = 5 / Total 1 = 5 
 
 
 
Total 0 = 3 (it counts when the FIELDS.NUMBER = 0
Total 1 = 2 (it counts when the FIELDS.NUMBER = 1


I didn't find an example for that, I think is very simple but I don't know how to do it.

I want to do it in a group footer sections.

Thanks,
Daniel Botero Correa

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Apr 2010, 09:57 AM
Hi Daniel Botero Correa,

I have attached a sample solution for your task. I have used two events and a global variable to count if the expression is valid.

You will need the AdventureWorks sample database which comes with the installation of the product. Just change the connectionString accordingly and you should be able to run it.

Let me know whether the proposed solution helps.

Kind regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel Botero Correa
Top achievements
Rank 1
answered on 27 Apr 2010, 10:59 AM
Hi Peter,

Thanks, yes i had done my solution like that but i wanted to do it automatically (for example with count function). So I have a question, Telerik's reports can be that automatically? the count function cannot count with conditions?

I think I'm gonna do my own function count and I will put it in my groups footer. When I do it, I will show you.

Thanks,
Daniel Botero Correa
Tags
General Discussions
Asked by
Daniel Botero Correa
Top achievements
Rank 1
Answers by
Peter
Telerik team
Daniel Botero Correa
Top achievements
Rank 1
Share this question
or