Mast head image

Dominant Condition vs. Dominant Component Results

This script retrieves the Dominant condition and the dominant component for the NCCPI interpretation for an area.


Text highlighted in yellow in the example script can be changed for a particular area or interpretation. Examples can be found on the Tips page.

Tips Page

Copy the example script below and paste it into the query page on the Soil Data Access site.

Soil Data Access Query Page

Example Script

SELECT areasymbol AS Area_symbol, musym AS Map_unit_symbol, muname AS Map_unit_name, mu.mukey/1 AS MUKEY, c.cokey/1 AS COKEY, compname AS Component_name, comppct_r AS Component_percent,

(SELECT TOP 1 ROUND (AVG(interphr) over(PARTITION BY interphrc),2)

FROM mapunit AS m1

INNER JOIN component AS c1 ON c1.mukey=m1.mukey

INNER JOIN cointerp AS ci1 ON c1.cokey = ci1.cokey AND m1.mukey = mu.mukey AND ruledepth = 0 AND mrulename LIKE 'NCCPI - National Commodity Crop Productivity Index (Ver 2.0)'

GROUP BY interphrc, interphr, comppct_r

ORDER BY SUM (comppct_r) over(PARTITION BY interphrc) DESC) AS Dominant_component_rating, interphrc AS Component_rating_class,

(SELECT TOP 1 interphrc

FROM mapunit AS m2

INNER JOIN component AS c2 ON c2.mukey=m2.mukey

INNER JOIN cointerp AS ci2 ON c2.cokey = ci2.cokey AND m2.mukey = mu.mukey AND ruledepth = 0 AND mrulename LIKE 'NCCPI - National Commodity Crop Productivity Index (Ver 2.0)'

GROUP BY interphrc, comppct_r

ORDER BY SUM(comppct_r) over(PARTITION BY interphrc) DESC) AS Dominant_component_class

FROM legend AS l

INNER JOIN mapunit AS mu ON mu.lkey = l.lkey AND l.areasymbol LIKE 'MO123'

INNER JOIN component AS c ON c.mukey = mu.mukey

INNER JOIN cointerp AS ci ON c.cokey = ci.cokey AND ruledepth = 0 AND mrulename LIKE 'NCCPI - National Commodity Crop Productivity Index (Ver 2.0)'

GROUP BY areasymbol, musym, muname, mu.mukey, c.cokey, compname, comppct_r, interphrc

ORDER BY areasymbol, musym, muname, mu.mukey, comppct_r DESC, c.cokey

Example Table Output

Description of tables and columns can be found on this link: Table and Column Descriptions

Area_symbol Map_unit_symbol Map_unit_name MUKEY COKEY Component_name Component_percent Dominant_component_rating Component_rating_class Dominant_component_class
MO123 73055 Alred-Rueter complex, 15 to 35 percent slopes, very stony 2501597 14025732 Alred 50 0.1 Low inherent productivity Low inherent productivity
MO123 73055 Alred-Rueter complex, 15 to 35 percent slopes, very stony 2501597 14025734 Taterhill 3 0.1 Moderately high inherent productivity Low inherent productivity
MO123 73139 Poynor-Clarksville-Scholten complex, 8 to 15 percent slopes, stony 2501611 14025777 Scholten 15 0.48 Moderately low inherent productivity Moderate inherent productivity



Helping People Help the Land

USDA is an equal opportunity provider, employer, and lender.