Electronic Health Records (EHRs) provide rich patient-level information that can be used to generate real-world evidence, derive real-world endpoints, and fulfill the promise of a learning healthcare system. Due to the complexity of the data, however, there are questions related to data quality, analytic methods, and appropriate use cases that must be considered before utilizing these endpoints. In oncology, commonly used endpoints include overall survival and endpoints based on disease progression and tumor response. The standard methods to collect these outcomes in clinical trials, however, may not be feasible using EHRs, but such data present an opportunity to answer research questions at a scale and recency not available from clinical trials, while also reflecting treatment patterns and populations seen in routine clinical practice. We illustrate the statistical challenges, opportunities, and learnings unique to analyzing EHR data with a case study on developing and validating endpoints in clinical oncology.