# Google Analytics 4 : Advanced query does not work properly/consistent

**URL:** https://matillioncommunity.discourse.group/t/google-analytics-4-advanced-query-does-not-work-properly-consistent/2246
**Category:** Matillion ETL
**Created:** [July 12, 2023, 4:21pm UTC](https://matillioncommunity.discourse.group/t/google-analytics-4-advanced-query-does-not-work-properly-consistent/2246 "2023-07-12T16:21:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Lion9876543211618923990717](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@Lion9876543211618923990717](https://matillioncommunity.discourse.group/u/Lion9876543211618923990717)
#### Post date: [July 12, 2023, 4:21pm UTC](https://matillioncommunity.discourse.group/t/google-analytics-4-advanced-query-does-not-work-properly-consistent/2246/1 "2023-07-12T16:21:07Z")

</div>

So, I have the query for combining 3 datamodels as following :

&nbsp;

SELECT t.Date, t.Hour, t.DeviceCategory, t.Browser

--, a.SessionSource, a.SessionMedium, a.Sessions&nbsp;

,t.TotalUsers

--,CAST(NULL as DECIMAL) as PercentNewSessions

, a.NewUsers, CAST(NULL as DECIMAL) as&nbsp;BounceRate

, CASE WHEN a.Sessions=0 THEN 0 else e.ScreenPageViews/a.Sessions END as PageviewsPerSession

,e.userEngagementDuration, CAST(NULL as DECIMAL) as GoalConversionRateAll&nbsp;

FROM Tech t&nbsp;

, Engagement e

,Acquisitions a

WHERE t.Date=e.Date and t.Hour=e.Hour&nbsp;

AND t.Date=a.Date and t.Hour=a.Hour

&nbsp;

The above query works fine, but when I uncomment lines 2 and 4, there is no data returned.

It shouldn't work as the above, since Im just adding/removing columns from select list. This behavior is buggy

&nbsp;

---

<div class="post-metadata">

### Author: ![ChikaMatillionCommunityMgr](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@ChikaMatillionCommunityMgr](https://matillioncommunity.discourse.group/u/ChikaMatillionCommunityMgr)
#### Post date: [July 12, 2023, 9:35pm UTC](https://matillioncommunity.discourse.group/t/google-analytics-4-advanced-query-does-not-work-properly-consistent/2246/2 "2023-07-12T21:35:01Z")

</div>

Hi [@Lion9876543211618923990717](https://matillioncommunity.discourse.group/u/Lion9876543211618923990717)​

Does this help[**https://support.matillion.com/s/article/UnabletoaddanewdatasourcewhenusingtheGoogleAnalyticscomponent**](https://support.matillion.com/s/article/UnabletoaddanewdatasourcewhenusingtheGoogleAnalyticscomponent) ?

Thanks,

Chika

---

<div class="post-metadata">

### Author: ![Lion9876543211618923990717](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@Lion9876543211618923990717](https://matillioncommunity.discourse.group/u/Lion9876543211618923990717)
#### Post date: [July 12, 2023, 10:48pm UTC](https://matillioncommunity.discourse.group/t/google-analytics-4-advanced-query-does-not-work-properly-consistent/2246/3 "2023-07-12T22:48:50Z")

</div>

That works, thank you. Please fix it in next version !
