Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
billhowe edited this page Jun 11, 2015 · 6 revisions

Empirical CDF

Does not work at the moment, because we cannot sort.

apply Counter(value) {
      [0 AS c];
      [c + 1 AS c];
      c;
};

AP = scan(AcquisitionsPrice);
NUM = [from AP emit count(price)];
SAP = [from AP order by price emit *]; -- order by does not yet work
Result = [from SAP emit Counter(price)/*NUM AS percentile];

store (Result, AcquisitionsCDF);

Join acquisitions with investments

Acq = scan(Acquisitions);
Inv = scan(Investments);

Funding = [from Inv
           emit company_permalink
              , sum(raised_amount_usd) as sum_raised_amount_usd];
Joined = [from Acq, Funding
          where price_amount > 0 and Funding.company_permalink == Acq.company_permalink
           emit price_amount, price_currency_code, sum_raised_amount_usd];

store (Joined, AcquisitionsProfit);

Clone this wiki locally