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

Detect the last group in a crosstab

1 Answer 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 13 May 2015, 01:46 PM

Hi, 
I need to use a special expression in the last group in a table. The first row I can detect by using

RowIndex("crossTab1") = 1
I want to use the same logic to detect the last group, but I can't find any indications of number of groups in the table or number of rows in a group (other than using COUNT aggregate).
I have now found a way to solve it by using

RowNumber("crossTab1") = EXEC("crossTab1", CountDistinct(Fields.Month))

However I feel that it is ineffective to count all rows in all groups. Is there a better way to accomplish this?

 

Best regards,

Anders

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 18 May 2015, 11:53 AM
Hello Anders,

There isn't another global object/specific function other than the Count/CountDistinct aggregate which will return the number of group rows in the current group. Thus, your approach to compare the row number with the month count is the recommended solution.

Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ken
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or