Expression Language Techniques
Name | Description & Example |
Find the First Record for a Student Restrictions: - Must be done after the Sort - Every column using this column must be done after the Sort. - The Sort MUST cluster all of each student's records together in a single block. | ${ row.studentID != prevRow.studentID} Use the spelling of "student ID" used by the field in your selected table. |
Find the Last Record for a Student Restrictions: - Must be done after the Sort - Every column using this column must be done after the Sort. - The Sort MUST cluster all of each student's records together in a single block. | ${ row.studentID != nextRow.studentID} Use the spelling of "student ID" used by the field in your selected table. |
Find the First Row in the Report - Must be done after the Sort - Every column using this column must be done after the Sort. | You can do this with any column that can't be "empty". Do this with an object id or other id column you know will never normally be empty: ${ empty prevRow.studentID } This will be true when the current row is the first row in the report (provided that the studentID field can never normally be blank) and false otherwise. |
Find the last Row in the Report - Must be done after the Sort - Every column using this column must be done after the Sort. | You can do this with any column that can't be "empty". Do this with an object id or other id column you know will never normally be empty: ${ empty nextRow.studentID } This will be true when the current row is the last row in the report (provided that the studentID field can never normally be blank) and false otherwise. |
Using a Parameter to control output | Create a parameter that contains - as a list - the options for how you want the report to behave. It's best if each option starts with a different letter - this makes processing the options easier. On the Parameters page, create a parameter with a type of "Custom List" ("Selecting from a drop down list that I create": ![]() These Strings can be anything you want: Final Total Only;Each Student's Total;All Students, All Rows;Totals for AP Students only;Include AP Course info with AP Students Use the "rw:startsWith" function to understand which option has been chosen for the paraeterm. You can then change the report's behavior based on which option hassnn ${ rw:startsWith(params.SHOW,'All') ? ... Helpful functions for determining which parameter has been chosen include: - startsWith - endsWith - contains - in |
Determining if a Timestamp falls before or after Noon | This technique assumes you have a Timestamp (e.g. row.yourTimestamp) or a Date (e.g. row.yourDate) that includes time information. To determine if your time falls before or after Noon, simply use the formatDate function to extract 'AM' or 'PM': rw:formatDate(row.yourTimestamp,'a') You can then compare the extract to AM or PM to determine whether the time is before or after noon: rw:formatDate(row.yourTimestamp,'a') == 'AM' ? 'BEFORE NOON' : 'AFTERNOON' |
Comparing two times numerically | This technique assumes you have a Timestamp (e.g. row.yourTimestamp) or a Date (e.g. row.yourDate) that includes time information. The easiest way to compare two times (within the same calendar day) is to convert them to integers on the '24 hour clock'. To do this you use hours from 0 to 23 (1am to 11pm) multiplied by 100 and add in the minutes: hours*100 + minutes The rw:formatDate function, coupled with the rw:toInteger function, is used for this: rw:toInteger(rw:formatDate(row.yourTimestamp,'HH') )*100 + rw:toInteger(rw:formatDate(row.yourTimestamp,'mm') ) Once your times have been converted to Integers, you can simply compare them numerically; A > B ? 'time A is later than time B' : 'time B is later than time A' |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article