You are on page 1of 13

SAP Analytics Cloud

How to create and connect a


R visualization to a SAC model in a story
May, 2018

Customer
How to create and connect a
R visualization to a SAC model in a story
Target: Tag Cloud visualization in SAP Analytics Cloud with R code

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 3


Step 1: Create a model based on the provided Excel file

Retail_Data.xlsx
https://jam4.sapjam.com/groups/jbwJUH0mTYH20yVy9HSVea/documents/Pj1hrj7MwPSfq4IXnviAtE

Retail_Data.xlsx Adem_Retail
© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 4
Step 2: Build a story in SAC using your model with this dimension & measure

Dimension: Lines
Measure: Quantity Sold

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 5


Step 3: Insert a “R Visualization” via menu

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 6


Step 4: Click on embedded item and activate “Designer”

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 7


Step 5: Click “Input Data”. Select “Lines” in Rows; “Quantity sold” in Columns

1 2

Select “Lines”

Filter “Quantity sold”

Hit “OK”

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 8


Step 6: Click on “Add Script” and enter the following R script (copy & paste)!
# load package
library(wordcloud)
# get words
Enter here
words <- Adem_Retail $Lines
# get frequency
frequency <- Adem_Retail$'Quantity sold'
# generate word cloud
wordcloud(words, frequency, scale = c(3, 1),
rot.per=0.2, colors=brewer.pal(8, "Dark2"))

Red = SAC Model Name


Green = Dimension and Measure in SAC Model

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 9


Step 7: Hit “Execute”

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 10


Step 8: You see the result. Hit “Apply”

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 11


Done ☺ Simple example but this should be only an easy one for the start!

© 2018 SAP SE or an SAP affiliate company. All rights reserved. ǀ Customer 12


Thank You

You might also like