NET LOSS PER SHARE (Tables)
6 Months Ended
Jan. 31, 2017
Earnings Per Share [Abstract]  
Schedule of Basic and Diluted Net Loss Per Share
The computation of basic and diluted net loss per share is as follows (in thousands, except share and per share data):
 
Three Months Ended
January 31,
 
Six Months Ended
January 31,
 
2016
 
2017
 
2016
 
2017
Numerator:
 
 
 
 
 
 
 
Net loss
$
(33,205
)
 
$
(93,212
)
 
$
(71,750
)
 
$
(255,381
)
Denominator:
 
 
 
 
 
 
 
Weighted-average shares—basic and diluted
43,666,825

 
141,996,600

 
43,252,879

 
108,185,194

Net loss per share attributable to common stockholders—basic and diluted
$
(0.76
)
 
$
(0.66
)
 
$
(1.66
)
 
$
(2.36
)
Schedule of Antidilutive Securities Excluded from Computation of Earnings Per Share
The potential shares of common stock that were excluded from the computation of diluted net loss per share attributable to common stockholders for the periods presented because including them would have been anti-dilutive are as follows:
 
Three and Six Months Ended
January 31,
 
2016
 
2017
Stock awards
34,306,230

 
44,813,334

Common stock subject to repurchase
1,504,001

 
551,750

Common stock warrants

 
51,270

Convertible preferred stock
76,319,511

 

Convertible preferred stock warrants
824,094

 

Total
112,953,836


45,416,354