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

IFF() function usage

1 Answer 279 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Balen
Top achievements
Rank 1
Balen asked on 17 Nov 2020, 04:48 PM

HI All, 
I currently have a report where i have a crosstab table that list staff and their respective logon time and break report. I would like to have a summary section at the top of the report and outside the cross tab so that we can indicate the staff with the heights break and the name of the staff.The orange area in the attachment.

Currently, i have attempted to use IFF function but it has not been successful as the true and false parts of the IFF functions are not only staff that meet the expression. I am currently using the following expression. 

=IIF((Fields.BreakDuration) > 0 AND Exec('table2', (Fields.BreakDuration)) <= Exec('table2', Max(Fields.BreakDuration)),
"Highest Agent Break Time: " + Fields.AgentName + " - " + Format("{0:00}:{1:00}:{2:00}"
                   , Truncate((Max(Fields.BreakDuration)) / 1000 / 3600)
                   , Truncate(((Max(Fields.BreakDuration)) /1000/60) MOD 60)
                   , Truncate(((Max(Fields.BreakDuration)) / 1000) MOD 60)
 ),"No Break Time ") 


1 Answer, 1 is accepted

Sort by
0
Mads
Telerik team
answered on 19 Nov 2020, 10:34 AM

Hello, Balen

I have spent some time trying to recreate the issue with the information provided but without much success. I came across one issue which I think might be a reason for the problem at hand:

When using the Exec function, the defined Scope must be a parent scope/element, which is why an element outside of the crosstab can not use the scope of the crosstab. Instead, you could use a List item, with the data-source set to the same data-source as the crosstab. Next, you can filter away all rows of data except the one with the longest BreakDuration by setting a filter like = Fields.BreakDuration Top N 1. This way the list will only have one cell with the highest break, and you can create a TextBox showing the AgentName and the formatted Duration.

I hope you find this information useful. If it does not help you achieve what you need, maybe you could provide some more information on how the Report is set up?

  • How is the Data designed and how is it set to the report? Is 1 row = 1 data-entry? And this DataSource is not set to the report itself, but directly to the crosstab?
  • These elements, the Main Table and the different text-boxes are in the detail section of the report?
  • Does your IIF function produce an error, or does it show data in the wrong way?

Let me know if the issue has been worked out, you need more help or have any other questions.

Regards, Mads Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Balen
Top achievements
Rank 1
Answers by
Mads
Telerik team
Share this question
or