Sunday 23 February 2020

10 Year Anniversary


I know I've not been so active on this blog of late, but I realized the other day that it has now been 10 years since I started and I felt I needed a post to at least commenerate that occasion.

And what a decade it has been. In 2010 I was a data analyst and Alteryx user a few months away from heading to a conference which at that point was called Extend The Reach, but in fact turned out to be the first ever Inspire.

Ten years on and I am a Principal Software Engineer working for Alteryx and on my way to my 15th Inspire conference, which with the Analyticon rebranding might turn out to be the very last.

To say this software has changed my life would be an understatement. But 10 years on I still love this product as much as I did when I first started using it. Last week I requalified for my advanced certification and enjoyed the thrill of once more using the product against the clock.

I look forward to catching up with all of you who will be in Sydney this week. I'm still excited as ever about Inspire and the people and challenges I will meet in the solution centre.

Adam

Monday 10 February 2020

Building a Better Record ID tool ...


Whilst visiting the Shambles in York, I was treated to a set of ACE inspired ghosts from my friend and fellow ACE, Rafal Olbert.  We searched the community of ghosts at the Ghost Merchant for the perfect trio of goblins to complete the set.  If you notice the coloring, they closely resemble the ACE logo on Raf's polo.  Who except us would spend the time rummaging through hundreds of ghosts to complete this task?
Now comes the question that you might be asking, "What does this have to do with CReW macros?"  It has everything to do with them.  Often there will be a simple task that has to be configured by many in the community.  The time spent in configuring a task could be better spent elsewhere (e.g. visiting York with friends).

There are multiple posts in the Alteryx Community asking how to get unique record IDs on groups of records.  There are also multiple ideas in the community to modify the functionality of the RecordID tool.  James Dunkerley presented at Inspire 2020 on the magic of modifying XML.  One example that he showed was the adding of the grouping functionality to the Record ID.

I grabbed a copy of his macro and have had it waiting for an opportunity to release it to the CReW user-base.  If you think about the construction of a macro that allows for GROUPING, you'll realize that the dynamic nature of grouping requires you to build a solution that allows for multiple (any) selections of fields from the incoming data stream.  James solved the grouping by modifying the XML in a formula:

IIF(IsEmpty([#1]) OR [#1]='""', "<GroupByFields />", 
'<GroupByFields><Field field=' 
+ Replace([#1], '","', '"/><Field field="')
+ '/></GroupByFields>')+ "/*" + [#1] + "*/"

He's modifying the XML of a standard Multi-Row Formula to update the GROUP BY parameter.  When no fields are selected, the resulting xml (grouping) looks like this:

<GroupByFields />

If the incoming data has three (3) fields selected for grouping, the results need to look like this:

<GroupByFields>
   <Field field="Field1"  />
   <Field field="Field2"  />
   <Field field="Field3"  />
</GroupByFields>

The macro is configured to read the incoming metadata and will populate a LIST BOX interface tool with all of the incoming fields.  When the user selects the fields (e.g. Field1, Field2, Field3), the question results are passed to an ACTION tool as a comma delimited series of values.  James then creates a formula to modify the output to produce the XML component displayed above.

If James had attended the BUILD 2 event in Nashville, this was one of the challenges posed.  He would have won that event.

If you'd like to download a copy of the macro, it is in the Alteryx Gallery and can be found here . Any feedback is welcomed.

Cheers,

Mark