I obviously had to jump on the election bandwagon and play with the data and tinker with how we present it! I have been accused far too often about having an opinion that potentially offends everyone but I shall refrain from that and speak only about the technology :).
We are inundated with polling data every single day and I thought it would be interesting to capture the volatility of this data over a period of time. We did some research of some suitable REST API that could be used as a data source and also a charting library that is simple and elegant. We found an API that gave us the response in JSON and XML (among other formats) and then wrote a utility to convert the XML response to an appropriate JSON format that the charting library accepts. We then leveraged MicroStrategy’s Visualization SDK to package this as a custom widget is called - General Election Polls (not very original but hey, I am not a marketer!).
While there are a few polling sources that we can extract data from, we chose HuffPost Polling which has its own REST API. This REST API exclusively tracks the current US presidential candidates. It can be invoked like any REST API via an HTTP request and the JSON or XML (depending on your choice) response includes daily poll numbers for all candidates including third-party candidates. For our example, we included only the two main candidates - Clinton and Trump.
Presenting the API Response via a MicroStrategy Report
We then used MicroStrategy’s XQuery reporting capabilities to call the API and generate a report that retrieves data in real time. We included this dataset in a dashboard and built our own custom widget.
So, why should you care?
Other than the fact that it is incredibly cool, it has a great use case for anyone who is trying to pull real-time data. The data is not sitting in a warehouse but is retrieved at run-time by invoking a REST API call. This custom plugin will enable you to leverage MicroStrategy built-in query capabilities to call REST APIs along with their Visualization SDK’s ability to integrate third-party charting libraries into MicroStrategy’s widget library. This will allow you to build widgets for data retrieved by invoking *any* REST APIs. For instance think of a stock trading application, wouldn't it be great to pull real-time information from say Yahoo! Finance.
Thoughts? Comments? I'd love to hear about how you see this being valuable to your use cases. I can be reached at firstname.lastname@example.org.
Photo by: DonkeyHotey (https://www.flickr.com/photos/donkeyhotey/)