Gooddata Report Showing Weather by Store - gooddata

I do have in my project model 3 datasets showing stores (DS_SITE), cities (Cidades) and weather (DS_DADOS_CLIMA) like in the image below:
datasets
And I want to see the name of the store with it's respectively weather information, but when I try select the store name to the report, it's not permitted:
report
how
There is some way to show the weather with the store name in the same report? I've changed the model and the metric several times trying to do it, but it didn't work.
Here is the metric I used in the example above (DS_DC_TEMP_MAX = weather fact):
metric

The direction of the arrow between City and Weather is what's preventing you from slicing temperature by Store.
Are you're sure about it? (as modeled, each city can have multiple weathers, each weather belongs to at most one city)?
If the direction is correct (you're probably tracking history of weathers), you'll need to lift weather to city, see explicit lifting:
https://help.gooddata.com/display/doc/Explicit+Lifting.
If you don't need to track history, just reverse the direction of the arrow between city & weather and you should be able to slice temperature by store (show them side by side).
Hope that helps.

Related

Amadeus api List of airport by country

Good day everyone,
Am using amadeus self-service for the first time, i wanted to know if it was possible to get list of airports by their country.
Thanks for the assist.
We do not have a specific API that retrieves airports in given countries. However, you could use our Airport Nearest Relevant API.
This API allows you to find all the airports around specific coordinates (latitude & longitude). You can query the API with the coordinates of the specific country (like the center) and play with the radius parameter (note that the maximum value is 500 kms). This will give you all the airports in this search radius. You can then filter the response by countryName to only retrieve airports in the given country. Of course depending on the size of the country you may need to do this process with multiple geocoordinates.

Binary Sankey Diagram in Tableau - Not All Activities Match The Corresponding Number of KPIs

How do I link my activities variable to only the corresponding KPIs variable?
Using guidance from a number of sources, but primarily the genius of Jeffery Shafer articulated through the SuperDataScience video, I built a Sankey Diagram for my work. For the most part it works, however, I have been trying to figure out how to adjust my Sankey Diagram model to line up each activity with ONLY the corresponding KPIs, but am having no luck.
The data structure looks like this:
You'll note I changed the binary value to "", 2 instead of 0, 1 as it makes visual calculations easier. For the "Viz" variable, I have "Activity" for the raw data set, then I copy/paste/replicate the data to mirror the data (required for the model) but with "KPI" for the mirrored data.
In the following image, you'll see my main issue is that the smallest represented activity still shows as corresponding to all KPIs when in fact it does not. I want activity to line up only with the corresponding KPIs as some activities don't correspond with all, or even any, KPIs.
Finally, here is the model very similar to what the above video link shows:
Can someone help provide insight into how I can adjust the model to fit activities linking only to corresponding KPIs? I appreciate any insight. Thanks!
I have a solution to the issue, thanks to a helpful Tableau support member named Anthony. It was in the data structure. The data was not structured to only associate "Activities" with their "KPI" values within Tableau's requirements, but every "Activities" value with every "KPI" value. As a result, to achieve the desired result, the data needs to be restructured to only contain a row for every valid "Activities" and "KPI" combination. See the visual below where data is removed to format properly:
-------------------------------------->
Once the table is restructured, the desired visual result should configure with the model. It works like a charm!
Good luck out there!

How to access weather data from all the stations in one country using openweathermap?

I am using Alteryx to extract weather data for a handful of cities and it works great. I'd like to expand this to able to download data for all weather stations in the UK. At the moment I am specifying which cities I want, e.g. London / Manchester.
Is there a way of specifying in the api call to download all stations in 'GB' or 'UK'?
Ideally I'd like to do this in one call rather than listing all locations which will be very laborious
Get a list of stations or cities that you want to retrieve weather data from. I found some good sources from openweather here: http://bulk.openweathermap.org/sample/
Then build a url request using the list of id's above that retrieves specific weather information. Using an id for the weather station in Cairns, id=2172797, the url ends up looking like:
http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=843798874aac0ef138e6f77c72f3af80
Note that this url will return an error because this isn't a real appid. If you replace the appid with your own, this url will give you data for that station.
Putting this process into Alteryx lets you put the list of station id's together with the url and the appid to make many calls into openweather and then process all of the data together. I could not find information from the API on rate limits, so be conscious of how many requests you are posting to the service.
There is an example of this process here: https://www.dropbox.com/s/yoppbx3bw0p4rug/Get%20individual%20stations.yxzp?dl=0
Keep in mind that you have to update the Appid in the text input tool within this sample as well.

Dynamic view models

If I'm about to split my application into read and write sides using CQRS principles how would you handle situation of having a "dynamic" read model scenario? E.g. I have a product that consists of several read properties (id, title, slug etc) but in order to display it to user I need to pass its price that is calculated by domain service (to which I pass visitor country and currency)? I can't store this price in database because user is free to change his currency anytime he wants + prices change quite often. So my final product view model should be basically a composite of raw-SQL columns (id, title, slug) and calculated price. Should I use the same view model that I get from the database and use content enrichment pattern or should I create a new view model for my composite?
Changing the price of the product is a COMMAND, it should update the price you store in the database which you then QUERY anytime.
The essence of CQRS is that your queries are not going any logic like that.
For currency conversion, since you say the user can change currency at anytime then you should query the entire list of currency rates and do the calculation yourself on the client side. Alternatively you could query for the base price then query for the current rate. And if the user changes currency you just query for the rate again but keep the same base price.

Get geo-locations from cities

I am trying to display a list of closest restaurants of a given city within a radius. In order to do this, I'll have to convert the city to a longitude/latitude.
When the user fills in his/her restaurant information, he/she will fill in the address. Based on that address i need to get a longitude/latitude and save that to the database.
I don't need to point this on a map. I'll be just displaying a list of all closest restaurants within the given radius to the user.
How can I do this with ASP.NET-MVC4?
Also, this project is based on Code First. And for address I have DbGeography as datatype set.
The project is kind of based on this tutorial
Edit
To avoid anyone else telling me this is not possible with ASP.NET on it's own, I am aware of that. an example with Google maps / .NET wrapper would be great.
This query itself is typically done in the database back-end because the program is the consumer of the data not the keeper of the data. You will have a table of restaurants, possibly for many cities, each restaurant having a latitude and longitude. You create a geospatial index on the table, which performs a tesselation for performance; you configure the tesselation parameters. You must determine the latitude/longitude of your restaurant-seeker's location. Your command object would feed that data to a stored procedure, along with the desired radius. The stored procedure would return an enumerable set of rows to your client program.
I found this .NET wrapper which fulfills my need.