Mast head image

Dominant Condition

This script retrieves the dominant condition for the NCCPI for an area.


Text highlighted in yellow in the example script can be changed for a particular area and 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,

(SELECT TOP 1 interphrc

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, comppct_r

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

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

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, interphr

ORDER BY SUM (comppct_r) DESC) AS Dominant_rating

FROM legend AS l

INNER JOIN mapunit AS mu ON mu.lkey = l.lkey AND mukind = 'complex' 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)'

ORDER BY areasymbol, musym, muname, mu.mukey

Example Table Output

Area_symbol Map_unit_symbol Map_unit_name MUKEY Dominant_class Dominant_rating
MO123 73055 Alred-Rueter complex, 15 to 35 percent slopes, very stony 2501597 Low inherent productivity 0.1
MO123 73150 Caneyville-Bucklick complex, 8 to 15 percent slopes, rocky 2501676 Moderately low inherent productivity 0.37
MO123 76045 Sandbur-Wideman-Relfe complex, 1 to 3 percent slopes, frequently flooded 2503295 Moderately high inherent productivity 0.61



Helping People Help the Land

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