How to connect SAP Analytics Cloud to SAP Cloud Platform IoT Application Enablement – part 2
Introducing
In the last blog we´ve seen how we can using a node js “proxy app” to get access via basic auth to the OData services from SAP Cloud Platform IoT Application Enablement (AE).
Pleas check also the other blogs about the series:
1 | How to connect SAP Analytics Cloud to SAP Cloud Platform IoT Application Enablement – part 1 |
2 | Build up an IoT App on top of SAP Cloud Platform Application Enablement |
3 | Deploy your SAP Cloud Platform IoT Application Enablement App to the Cloud Foundry Environment |
4 | How to display a route in a SAP Cloud Platform Application Enablement IoT Application |
5 | How to connect SAP Analytics Cloud to SAP Cloud Platform IoT Application Enablement (this blog) – part 1 |
6 | How to connect SAP Analytics Cloud to SAP Cloud Platform IoT Application Enablement – part 2 (this blog) |
Overview
In the upcoming line i will now show how retrieve the data in SAP Analytics Cloud (SAC) an finally we build up an simple visualization of our data.
But first of all, lets have a look about the scenario as a little recap:
As we now from the last blog we will now switch to SAP Analytics Cloud (SAC):
In Detail we proceed these simple steps:
- Create a new connection on SAC
- Create a new Model
- Create a Story to display the data
Create a new connection for SAP CP IoT AE ind SAP Cloud Analytics
Afte we´ve succesfully logged in to our SAC tenant, choose from the menu the “Connection” entry:
And create now a new connection from type “OData Services”:
Provide the following details:
Connection Name | e.g. SAP Cloud Platform IoT Application Enablement |
Description | e.g. SCP IoT AE conn. via basic auth |
Data Service URL
|
https://sap-proxy.cfapps.eu10.hana.ondemand.com/app.svc |
Authentication Type | Basic Authentication |
User | <user> |
Password | <password> |
The final result should look like this:
Save the config by pressing the OK button.
Create a new Model
After we´ve successfully added our connection, we need now to create a new Model.
For this chose from the menu “create > model”:
In the upcoming screen choose “Get data from an app” option and select OData Services:
Now we select the connection which we´ve create before and select “Create a new query”:
In the next screen we get now the first response from our “proxy/OData service” not bad ;o)
That´s looks identical to our entities which we get requesting the following url:
https://sap-proxy.cfapps.eu10.hana.ondemand.com/app.svc/$metadata
Create the query
After we select the “Build Query” option on our “Aggregates” entity we can define the query by drag an drop the required properties:
We need now to define this one via the “queury builder”
/aggregates?$filter=id eq 'id1' and time ge datetime'2017-01-01T00:00:00' and time lt datetime'2017-03-01T00:00:00'
id1 = SAP CP IoT AE Thing ID
The result which we´re using to retrieve our data looks like this:
If it works we get now an info about our query:
and by clicking on it, we get an overview from our raw data which are uploaded to SAC:
Afterwards we can now create the model (i do not changing here anything) and finally we see it now under models in SAC:
Create the story of your IoT data
The last step for now is to creat a new story based on our data.
For this choose again the menu>create>story:
Choose a template of your choice or start with a blank page:
Afterwards we can now define the charts with the measures and dimensions. As result we get now our dashboard about our SAP CP IoT AE data (based on the aggregates OData service):
Thats it…..happy easter!
Conclusion
Finally i think another nice way to combine different tools and technology to get access to our IoT data.
I know the use of the node js app. as proxy to bypass OAuth is not the best way and hopefully SAP Analytics Cloud allows soon the option of OAuth based authentification.
But i works…..
cheers,
fabian
Helpful links:
SAP Analytics Cloud – Import Data Connection to OData Services
SAP CP IoT AE – API documentation for Aggregates of Measurements
Hello,
is there a way to create a LIVE data connection between SAP AC and SCP IoT Application Enablement ?
thanks
Hello Fabian,
great blog to wrap SCP AE 🙂
I got a question corresponding to the created link. The link with the ending /app.svc shows following message:
{"args":["Invalid Api call"],"message":"Wrong API endpoint or the endpoint does not exist.","messageId":"invalidAPIEndpoint","correlationId":"b3fbede1-645e-4826-7f08-18f4cbd2d7c1","causes":[],"status":404}
The same link with /app.svc/$metadata shows the dataservice like in your blog but is not applicable to SAC. How do you solved that?
Best regards
Volkan