As a typical ecosystem type on the Loess Plateau, the grain and grass complex ecosystem plays a vital role in maintaining regional food production and animal husbandry development. Understanding the characteristics of carbon water flux and energy partitioning in the grain and grass complex ecosystem on the Loess Plateau is of great significance for understanding the regional climate, carbon water cycle and its coupling process on the Loess Plateau. The dataset contains the carbon and water flux data accumulated by the National Field Scientific Observation and Research Station of Qingyang Grassland Agricultural Ecosystem, Lanzhou University, from January 2019 to December 2021. The data indexes include net ecosystem exchannge (NEE) of CO2, total ecosystem productivity (GEP), ecosystem respiration (RE), evapotranspiration (ET), latent heat flux (H), net radiation (Rn), and rainfall (P). The studied ecosystem is a grain and grass complex ecosystem, which belongs to the typical agricultural production type of the Loess Plateau and has strong regional representation. The dataset was prepared in strict accordance with international flux observation technical standards from field observation, data warehousing, and quality control to flux calculation. The comprehensive and high-quality data in this dataset can provide a foundation for research on crop production, efficient use of water resources, carbon source and sink management, and response to global climate change in the Loess Plateau.