Difference between revisions of "Using Data from a Report as Criteria for Another Report"

From SmartWiki
Jump to: navigation, search
m (Updated syntax and added additional detail around specifying column number.)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
The result data set from a report can be used as criteria for another report using the following syntax:
 
The result data set from a report can be used as criteria for another report using the following syntax:
  
:<font size="3">'''@Report['''''reportid'',''column #'',''data type''''']@'''</font>
+
:<font size="3">'''@Report['''''reportid''''';'''''column #''''';'''''data type''''']@'''</font>
  
where data type is 0 for numbers and 1 for text
+
where ''data type'' is ''0'' for numbers and ''1'' for text.
  
on report one (id=12345) - select tracking id, firstname, lastname from funding uta where userid=@userid@ (current user) and rolename="Conflict"
+
For example, if report 12345 has the userid of all level 1 owners for a particular UTA, the following [[criteria]] could be used in another report to filter for only those users found in report 12345.
 +
userid IN( @Report[12345;1;0]@ )
  
This return all item where current user is in conflict.
+
where ''12345'' is the [[Determining the reportid|report id]], ''1'' means use the data in the 1st visible column of that report, and ''0'' means that that column contains numbers as opposed to text strings.
  
 +
The column # should indicate the VISIBLE column number when viewing the report, not the actual column number within the builder (columns with the 'Show' checkbox checked).
  
on report two  -select tracking id, funding name, panel name from funding uta, panel uta where panel user=current  user
+
==See Also==
This return all funding item where current user is in panel committee.
+
* [[Determining the reportid]]
  
  
Next step is to put report one as a criterion on report two.
+
[[Category:Reports]][[Category:Criteria]]
 
 
userid=@userid@ and userid NOT IN( @Report[12345;1;0]@ )
 
 
 
where 12345 is the report id, 1 means use the data in the 1st column (there are 3 columns on report one) and 0 means the column contains numbers.
 
 
 
 
 
[[Category:Reports]]
 

Latest revision as of 16:42, 22 June 2015

The result data set from a report can be used as criteria for another report using the following syntax:

@Report[reportid;column #;data type]@

where data type is 0 for numbers and 1 for text.

For example, if report 12345 has the userid of all level 1 owners for a particular UTA, the following criteria could be used in another report to filter for only those users found in report 12345.

userid IN( @Report[12345;1;0]@ )

where 12345 is the report id, 1 means use the data in the 1st visible column of that report, and 0 means that that column contains numbers as opposed to text strings.

The column # should indicate the VISIBLE column number when viewing the report, not the actual column number within the builder (columns with the 'Show' checkbox checked).

See Also