diff --git a/2018-12-16 SSIS.zip b/2018-12-16 SSIS.zip deleted file mode 100644 index 20c820a..0000000 Binary files a/2018-12-16 SSIS.zip and /dev/null differ diff --git a/raportowanie.r b/raportowanie.r new file mode 100644 index 0000000..e1dd5df --- /dev/null +++ b/raportowanie.r @@ -0,0 +1,30 @@ +require(odbc) +require(dbplyr) +require(dplyr) +require(tidyr) +require(ggplot2) + +con <- DBI::dbConnect( + odbc::odbc(), + .connection_string = 'driver={SQL Server};server=mssql-2016.labs.wmi.amu.edu.pl;database=bigdata_s26450;trusted_connection=true') + +countries <- tbl(con, "dim_countries") +drugs <- tbl(con, "dim_drugs") +time <- tbl(con, "dim_time") + +tbl(con, "FT_Refund") %>% + inner_join(countries, by = c("country_fk" = "country_sk")) %>% + inner_join(drugs, by = c("drug_fk" = "drug_sk")) %>% + head(n = 500) %>% + ggplot(aes(price, reimbursement_amountPercent, color = country_name)) + + geom_point() + + xlab("Cena") + + ylab("% zniki") + + +tbl(con, "FT_Refund") %>% + inner_join(time, by = c("response_time_fk" = "time_sk")) %>% + filter(year == 2009) %>% + head(n = 500) %>% + select(year, month, day, price) +