320 likes | 327 Views
Join SQL & U2 criteria, order of operations, logic conditions, compound conditions, subselects, scalar joins, and U2 conditions in Informer 4.
E N D
February 11-13, 2019 Raleigh, NC
Informer 4: Advanced Criteria Options for SQL & U2 Presenter: Sarah Rodger Informer Support Specialist
Overview • Joint SQL & U2 Criteria • SQL Criteria • U2 Criteria
U2 & SQL Criteria • Order of Operations • Logic conditions: And, Or, Not • Compound Conditions
Order of Operations • Order matters? • Yes for performance! No for result content. • Processed Top-down so… • Place the most restrictive condition first • Parenthetical grouping (Compound Condition) • Order matters • (1 + 2 ) * 3 = 9 but 1 + (2 * 3) = 7 • U2: Put I-Descriptors/Computed Columns last • You can’t use these to filter if they are in a linked File
Logic Conditions • AND = all conditions have to be true (both) • OR = only one condition has to be true (either) • NONE = none of the conditions are true
Condition Examples AND OR NONE
Compound Conditions • Mix conjunctions • Use Parenthetical grouping: a and b and (c or d) AND OR
SQL Overview • Subselects • Scalar Joins
SQL Subselect There are three main reasons why you woulduse a subselect in your Informer report. You want to… • see if a value occurs in a certain dataset • see if a value does not occur in a certain dataset • compare a value to an aggregate value from a certain dataset
SQL Subselect / Value in Dataset? Example: List all products with orders of at least $10,000 Return:a unique list of IDs
SQL Subselect / Value not in Dataset? Example: List all products that do not orders of at least $10,000 Return:a unique list of IDs
SQL Subselect / Compare to Aggregate? Example: List all sales reps with a sales quota more than the average sales quota for all reps. Return:a unique list of IDs
SQL Scalar Joins Add constraints to the link conditions: Language = English
SQL Scalar Joins Use in a report like this: create a report from the Country table and list code from Country, and Language from our new link, the result set will list only the countries with English as one of the languages
SQL Scalar Joins Produces
U2 Conditions • Using Select Return • Select Return Conditions: AND, OR, NOT • Associated Multivalues: parallel arrays
U2 SELECT/RETURNING • Same as SELECT…SAVING UNIQUE… • Return distinct list of @IDs from selected records • Files must have reverse links • Forward links are not required
U2 SELECT/RETURNING example “Return a list of Person IDs that ordered this year”
U2 SELECT/RETURNING conditions • Using multiple SELECT/RETURNING conditions • Conjunction determines operator: • Intersect / AND / Both • Union / OR / Either • Difference / NOT
U2 Conditions: Intersect / And • Use AND conjunction • Values that only exist in both lists “Return a list of Person IDs that ordered both this year and last year”
U2 Conditions: : Union / Or • Use OR conjunction • Combines Lists “Return a list of Person IDs that ordered either this year or last year”
U2 Conditions: Difference / Not • Use AND with NONE Compound Condition • Values that exist in one list but not the other “Return a list of Person IDs that ordered this year but not last year: the list of new customers”
U2 Multivalues: Limiters • Field containing multiple values (an array) • Use of Limiter: Any, Every, No, When
U2 Multivalues: Limiter Any Any of the values match the condition
U2 Multivalues: Limiter Every Every value must match the condition
U2 Multivalues: Limiter No None of the values match the condition
U2 Associated Multivalues: When • Use with two or more related multivalue fields • Ex: Status and Status Date are linked • Use WHEN delimiter for each condition • Example follows…
U2 Associated Multivalues: When • For example, • if you have a multivalve field for status and one for status date • and you want to know every record that had a certain status on a certain date • You would use the WHEN limiter on both conditions. • For an associated comparison to work correctly, the two multivalve fields • have to be associated in the database file's dictionary
Resources: Search the Help Center These articles are available with more detail • SQL: Creating Scalar Joins • SQL: Using Subselects • How to Create a Compound Condition • How to Use a Select Return Condition (For U2 Databases Only) • Training and User Guides: Informer Report User Training Guide
I4 Advanced Criteria Options Thank you! Any Questions?
February 11-13, 2019 Raleigh, NC