Skip Navigation
Expand
Custom Scripts Run After Report Execution
Answer ID 10247   |   Last Review Date 10/04/2018

Why don't the Record Count & Pages areas update when I run a custom script using unset()?

Environment:

Reports, Custom Scripts, Oracle B2C Service 20C and earlier

Issue:

A report shows an inaccurate Record Count & Page Count, which does not correspond with the actual number of records displayed by the report. 

Resolution: 

This content is applicable for Oracle B2C Service up through version 20C. For versions 20D and later, see Answer ID 11780: Custom Scripts Replacement by Analytics Extensions for best practices.

In a report which has a custom script the order of operations is: first the report runs populating both the "Records" & "Pages" areas. After this happens, the custom script executes.
 
If you have a custom script which uses the unset() function, it hides the rows as specified at this time. What it does not do is remove the rows from the report. Therefore, the Records & Pages areas are not effected by this function. This behavior is as-designed so we generally recommend using filters rather than scripting to reduce results returned in reports.