Skip to content

Instantly share code, notes, and snippets.

View petrolmer's full-sized avatar

Petr Olmer petrolmer

View GitHub Profile
require 'rubygems'
require 'gooddata'
require 'pp'
require 'json'
require 'csv'
require 'pmap'
require 'set'
require 'optparse'
require 'yaml'
@petrolmer
petrolmer / logr
Created November 24, 2014 23:46
Logr - features
import sys
import os
import csv
filename = 'opportunity_history.csv'
infile = csv.DictReader(open(filename))
stagehistory={}
for row in infile:
if row["Id"] == "Id":
continue
@petrolmer
petrolmer / saved_views.rb
Last active August 29, 2015 14:07
Turns saved views on/off on all dashboards for the specified list of projects.
require 'gooddata'
require 'json'
# 1 = turn on, 0 = turn off
SAVED_VIEWS = 1
# includes list of project ids
FILENAME = 'projects.txt'
# enter your credentials here or call simply connect() to use credentials from your auth store
client = GoodData.connect('ENTER PLATFORM USER', 'ENTER PASSWORD')
@petrolmer
petrolmer / replace_date_dim.rb
Last active August 29, 2015 14:06
GoodData Automation SDK: Replace one date dimension with another in all metrics and reports.
# If your new dimension is not in the project yet:
# 1. Clone your project.
# 2. Put new fiscal dim to a project, connect it to the same datasets as the original date dimension.
# 3. Remove links to the original dimension but do not delete the dimension from the project.
# This should make most of the reports "not computable"–don't worry, that's expected.
# 4. Check/fix your GD Dataset Writers and reload data.
# 5. Run the script.
# replace the strings with your date dimension names:
# if your dataset is called "Date (Activity)", put only "Activity" here