What did Donald say?

Today was presentation day. The task was to connect to some data via an API and extract some of Donald Trumps most famous quotes. My goal once I had extracted the data was to build a dashboard showcasing some metadata surrounding the quote. I could then visualise the quotes themselves.

Connecting to the API

Before connecting to the API, I first had to retrieve all the topic ids (topics being the subject matter of the Don’s quotes). Once I had the topic id’s, I could then retrieve all the quotes associated with that topic via another API call.

Alteryx Workflow

So, the first move was to retrieve all the topic ids. I simply needed to use the download tool to download the data from the API URL. No authorization was required for this API call. Once I had downloaded this data, since it was in a JSON format, I then needed to utilse a JSON parse tool. Then I could filter out the rows that contained the topic ids. Once I had the topic ids, I could then use that field for the control parameter in my batch macro (will be important soon). The other input I had for the batch macro was just the URL needed to retrieve the quote associated information from the API.


Batch Macro

The batch macro was used so that I could retrieve all the quote associated information for each topic. Within this batch macro, I had another download tool which would extract the information associated with the quote. However, this time I did need to query the data in the download tool. This is where the control parameter was used, as it would update the topic inside the download tool. So, each time the batch macro ran, I would retrieve all the information for each topic. The output of my batch macro gave me the quote associated information.

Once the batch macro was run, I was able to run a series of tools to take the quote and quote associated information from columns to rows. The main tool I want to mention here apart from the formulas and filters is the cross tab. This was crucial in bringing the information contained in the columns to the rows. I then added some new columns which would flag a quote on whether it had some interesting key word I thought Trump may say. I then outputted this data as a hyper file for tableau.

Tableau Dashboard


Given the time restraints of the presentation, I didn’t get to go as fancy as I would’ve liked. However, I was able to provide some general information about the quotes the Don has said. I created some bans which showcased the frequency in which certain interesting key words were said. I also created a bar chart which showcased the most popular topic by the number of times it was associated with a quote.

On this bar chart, users can filter to the top X topics. They can also select one of the topics and filter the line chart on the right. This line chart showcases at what point in time Donald Trump said the quote, as well as the actual quote itself via a viz in tooltip. Through these two charts, a user would be able to select a desired topic and see when all the associated quotes were mentioned.

Although I did not get the opportunity to due to time restraints, I would’ve liked to add another filter. This filter would have allowed the user to see all the quotes associated with some event. Such as all the elections Trump was associated with.