on 2019 Dec 10 11:58 AM
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..
Request clarification before answering.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
gokce_ozturk8
detail blog
User | Count |
---|---|
30 | |
21 | |
16 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.