BUSINESS COMBINATIONS - Pro Forma Information (Details) - USD ($)
$ / shares in Units, $ in Thousands
6 Months Ended
Jan. 31, 2017
Jan. 31, 2016
Business Acquisition, Pro Forma Information [Abstract]    
Revenue $ 349,970 $ 194,883
Net loss $ (256,293) $ (87,864)
Basic net loss per share (in dollars per share) $ (2.36) $ (1.95)
Diluted net loss per share (in dollars per share) $ (2.36) $ (1.95)