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

Pareto chart in SAC

0 Kudos
2,203

Hello All,

I am facing a problem in creating a pareto chart in SAP Analytics cloud (SAC).

Que 1: I want to confirm whether we can create pareto charts in story mode using calculated measures and dimensions or we have to use some kind of scripting?

Que 2: I tried using R visualization to create pareto charts

The difficulties I am facing are

1. I am unable to group common supplier entries due to which deviation in the cumulative trend is visible.

2. Cannot introduce horizontal scroll bar due to which, for more number of entries chart is very cluttered.

3. I am not able to use dual axis due to which bottom % of suppliers are not even visible.

Attaching the screenshots and code used:

Code:

library(plyr)
library(dplyr)

library(plotly)


df<-data.frame(SPEND_ANALYTICS)


#Performing the descending sort
df <- df[order(df$SPEND, decreasing=TRUE), ]


#Converting the categorical variable to a factor()
df$Vendor <- factor(df$Vendor, levels = rev(unique(df$Vendor)), ordered=TRUE)



df$Percentage <- (df$SPEND*100)/sum(df$SPEND)
df$cumulative <- cumsum(df$Percentage) is.num <- sapply(df, is.numeric)
df[is.num] <- lapply(df[is.num], round, 3) df1 <- filter(df,df$cumulative <= Threshold3) df1
Count_vendors <- count(df1) library(ggplot2)



b <- ggplot(df1, aes(x=df1$Vendor)) +
geom_bar(aes(y=df1$Percentage), fill='blue', stat="identity") +
geom_point(aes(y=df1$cumulative), color = rgb(0, 1, 0), pch=16, size=1) +
geom_path(aes(y=df1$cumulative, group=1), colour="slateblue1", lty=3, size=0.9) +
theme(axis.text.x = element_text(angle=90, vjust=0.6)) +
ggtitle( paste( "No. of suppliers contributing top", Threshold3, "% Spend :", Count_vendors) )+
labs( subtitle = "", x = 'Suppliers', y =
'Percentage')

ggplotly(b)

Thanks in Advance..

View Entire Topic
avsalynin
Active Contributor

pratik1612

yes, you can embed a Pareto chart through a custom widget.
for example, AnyChart - link or AmChart - https://www.amcharts.com/demos/pareto-diagram/

How it looks in SAC (i mean sample of AmChart) - https://www.youtube.com/watch?v=0_DyQDN46-s

p.s. respect Ferry Djaja)

0 Kudos

Hello Aleksey,

Thanks for your answer. Do you know how to implement AmChart to SAC?

Thanks a lot,

avsalynin
Active Contributor
0 Kudos

gokce_ozturk8

detail blog