community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Google analytics-Date ranges changes itself!!!

Highlighted

HI

 

Ive got a number of monthly workflows that get data from the Google Analytics connector using the date range "Last Month" so whatever the previous month is, the data is collected.

 

This should select the dates as the previous whole calendar month, ie today is 4th March 2019, so it should pick data from 1st Feb 2019 to 28th Feb 2019

It does.

However when i open the workflow to run it the following month, the date range is set to "custom" and hard set at 1st feb to 28th Feb. basically moving from a relative date to an absolute date.

 

I was convinced it was me, for ages, now i know it isnt., any ideas on fixing this? Cos this means i cant save workflows to server (when ive figured out how) cos  "last month" wont work as a relative date as it will always have to be manually altered.

 

Alteryx Certified Partner
Alteryx Certified Partner

Hi,

 

I've experienced the same problem and had a look at the macro Google_Analytics.yxmc. There is a DropDown tool (preDefDropDown) to select the "Preset Data Range", and the corresponding startDatePicker and endDatePicker Date tools, Based on the selection made, the date range is calculated by a formula.

The problem seems to be, that the interface has been created using HTML Gui, especially populating the DropDown tool with a list of selections:

<!-- Date Pickers fieldset -->
<fieldset id="datePickers" style="display:none;"><!--Add a display:none during process story-->
<legend>XMSG("Select Dates to Include")</legend>
<div id="preDefDateRange">
<label for="preDefDropDown">XMSG("Preset Date Range")</label>
<alteryx-pluginwidget type="DropDown" id="preDefDropDown" dataName="preDefDropDown">
<alteryx-option uiobject='XMSG("Custom")'>custom</alteryx-option>
<alteryx-option uiobject='XMSG("Today")'>today</alteryx-option>
<alteryx-option uiobject='XMSG("Yesterday")'>yesterday</alteryx-option>
<alteryx-option uiobject='XMSG("Last 7 Days")'>last7Days</alteryx-option>
<alteryx-option uiobject='XMSG("Last Week")'>lastWeek</alteryx-option>
<alteryx-option uiobject='XMSG("Last 30 Days")'>last30Days</alteryx-option>
<alteryx-option uiobject='XMSG("Last Month")'>lastMonth</alteryx-option>
<alteryx-option uiobject='XMSG("Month to Date")'>monthToDate</alteryx-option>
<alteryx-option uiobject='XMSG("Year to Date")'>yearToDate</alteryx-option>
<alteryx-option uiobject='XMSG("Last Year")'>lastYear</alteryx-option>
</alteryx-pluginwidget>
</div>
<br>

 

So each time you open the interface for selection, date range  is reset to "Custom".

 

I've saved to workflow with the settings I needed ("Month to Date" worked for my application) and tried it by simply changing the system date
and it worked fine, unless I opened the interface - this seems to lead to a "date reset".

I think, the specified selection is saved within the workflow and the date range is calculated by the formula within the macro, so running the
workflow on the server should work  (at least it does during my tests).

 

Best regards

 

Roland

that all seems to be exactly what would work!

i'll give it a go, getting GA macro onto the gallery isnt working at moment, but I'm bookmarking your solution for then.

thanks a lot!

 

Labels