Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
jblank
Contributor III
Contributor III

Pull Google Analytics data from previous month

Hello,

I wonder if anyone has an idea how to dynamically pull GA data from entire previous month?

My load script is using the specific URI query from API:
4_Q%26start-date%3d$(vGoogleMinQueryDate)%26end-date%3d$(vGoogleMaxQueryDate)&appID

In order to set those two variables I was trying

SET vGoogleMinQueryDate = date(monthstart(Today(), -1),'YYYY-MM-DD');

SET vGoogleMaxQueryDate = date(monthend(Today(), -1),'YYYY-MM-DD');

But that way, it returns that entire string as variable while Google expects something like '2022-10-01' / '2022-10-31'.

I believe it must be a simple fix - does anyone has an idea?

 

Many thanks,

Joerg

 

 

Labels (1)
1 Solution

Accepted Solutions
jblank
Contributor III
Contributor III
Author

Ah - my inexperience led me to above´s question - actually I just figured a solution it´s LET rather than SET ;):

LET vGoogleMinQueryDate = date(monthstart(Today(), -1),'YYYY-MM-DD');
LET vGoogleMaxQueryDate = date(monthend(Today(), -1),'YYYY-MM-DD');

So that seems to do the job!

 

 

View solution in original post

1 Reply
jblank
Contributor III
Contributor III
Author

Ah - my inexperience led me to above´s question - actually I just figured a solution it´s LET rather than SET ;):

LET vGoogleMinQueryDate = date(monthstart(Today(), -1),'YYYY-MM-DD');
LET vGoogleMaxQueryDate = date(monthend(Today(), -1),'YYYY-MM-DD');

So that seems to do the job!