cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Date not grouped in story with Datasphere model

jlopezm
Participant
0 Likes
1,338

Hello SAP Analytics Cloud and SAP Datasphere experts.

I have made an analytics model following this flow:

Replication Flow > Table > SQL View > Analytic Model

Within that process, I have a table that stores a field (ERDAT) as String since that is how I get it from the SAP table. In the SQL View I transform it into a date with the to_date() function. And this is done correctly, however, when I go to view it in the SAP Analytics Cloud history and I want to, for example, set a filter, they do not appear grouped as when I create the model directly in SAP Analytics Cloud:

jlopezm_1-1720012952741.png

 

but by individual dates:

jlopezm_0-1720012905589.png

I don't know how I can change this setting in SAP Datasphere. Or if it is something to change in SAP Analytics Cloud.

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

jlopezm
Participant

Thanks @N1kh1l  for the start of what was the solution for me. Besides creating the SAP DS Time and Date dimension I had to follow a few more steps, which I don't know if they are too many or if any are left over, but they worked for me:

I created a new association in the table

jlopezm_0-1720423509990.png

And we link by dragging the two fields of the table and the Time Dimension - Day :

jlopezm_1-1720423538202.png

We will use the Date field (String) since SAP provides the data in String type YYYYYMMDD and not in DATE format. Save and deploy.

In the SQL view (fact) we will associate the SQL view with the dimension in the details side panel, in the Associations section:

jlopezm_2-1720423604982.png

Here we must also drag to make the association:

jlopezm_3-1720423621470.png

In this case we do it by the Date field since we have transformed, from the SQL view, the initial data from String to Date. Save and deploy.

Finally, in the analytical model, when creating it and adding the fact, we have to make sure that we add this field:

jlopezm_4-1720423687931.png

When you do so, a drop-down will automatically be added to the date dimension:

jlopezm_5-1720423704162.png

If we look at the detail we can choose all the attributes that we want to be loaded

jlopezm_6-1720423729622.png

Then we simply save and deploy.

Answers (1)

Answers (1)

N1kh1l
Active Contributor

@jlopezm 

I think just converting the string to date will not create the necessary hierarchies. I think you would need to create the SAP DS Time and Date dimension.

https://community.sap.com/t5/technology-blogs-by-sap/understanding-time-tables-dimensions-in-an-sap-...

https://developers.sap.com/tutorials/data-warehouse-cloud-graphical5-timetables..html

 

Hope this helps !!

Nikhil

jlopezm
Participant
0 Likes
Thanks for the answer. I have managed to create the SAP DS Time and Date dimension, but what I can't get my model to take the hierarchy to SAC. I have a table where I have included the association by the ERDAT field. I also made the association in the SQL View using the association field and also joining it in the SQL query. But none of this is working for me to get the hierarchy to appear in SAC. would you know what step I am missing? Thank you very much!