CData Python Connector for Google Analytics

Build 24.0.9060

Server Side Filtering

Server Side Filtering

Fully qualified queries support both the OR and AND operators used together. The OR operator can only be used with the same columns if it is combined with the AND operator for filtering dimensions or metrics. If the OR operator is used with different columns in combination with the AND operator, it may produce unexpected results. For example, the following query may give unexpected results:

 SELECT * FROM [Acquisitions] WHERE [StartDate] = '2023-03-22' AND [EndDate] = '2023-03-22' AND [PagePath] LIKE '%as' OR [Country] LIKE 'US' 
Given below are a few valid queries:
 SELECT * FROM [Acquisitions] WHERE [StartDate] = '2023-03-22' AND [EndDate] = '2023-03-22' AND ([Country] LIKE 'US' OR [Country] LIKE '%In') 

 SELECT * FROM [Acquisitions] WHERE [StartDate] = '2023-03-22' AND [EndDate] = '2023-03-22' OR [PagePath] LIKE '%as' 

 SELECT * FROM [Acquisitions] WHERE [PagePath] LIKE '%as' OR  [PagePath] LIKE 'A' OR [Country] LIKE '%In' 

 SELECT * FROM [Acquisitions] WHERE [PagePath] LIKE '%as' AND [Country] LIKE '%In' 

 SELECT * FROM [Acquisitions] WHERE [PagePath] LIKE '%as' AND ([Country] LIKE 'India' OR [Country] LIKE '%US') 

 SELECT * FROM [Tech] WHERE [StartDate] = '2021-01-01' AND [EndDate] = '2021-05-18' AND [NewUsers] >= 26 AND [NewUsers] < 35 AND ([Browser] IN ('Chrome', 'Edge') OR [Browser] = 'Edge') 

 SELECT * FROM [TechDeviceModelReport] WHERE [Date] >= '2020-05-13' AND [Date] <= '2023-06-13' AND [DeviceModel] != '(not set)' AND [DeviceModel] != '(test)' AND ([NewUsers] = 15 OR [NewUsers] = 20) 

 SELECT * FROM [Tech] WHERE [StartDate] = '2017-01-01' AND [EndDate] = '2023-05-02' AND CONTAINS ([Browser], 'ed') OR CONTAINS ([Browser], 'ch') 

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060