# HHINCOME recodes (eg camb\_hhinc1, acs 2010-2) not working. query collapses to a single row.

**URL:** <https://forum.ipums.org/t/hhincome-recodes-eg-camb-hhinc1-acs-2010-2-not-working-query-collapses-to-a-single-row/599>\
**Category:** USA\
**Created:** [August 5, 2014, 12:53am UTC](https://forum.ipums.org/t/hhincome-recodes-eg-camb-hhinc1-acs-2010-2-not-working-query-collapses-to-a-single-row/599 "2014-08-05T00:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cliff](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@Cliff](https://forum.ipums.org/u/Cliff)\
**Post date:** [August 5, 2014, 12:53am UTC](https://forum.ipums.org/t/hhincome-recodes-eg-camb-hhinc1-acs-2010-2-not-working-query-collapses-to-a-single-row/599/1 "2014-08-05T00:53:00Z")

</div>

A series of 3 recodes of HHIMCOME appeared to work based on the results returned for the recode (eg, camb\_hhinc1, ACS 2010-2) but when used in a query with NUMPREC the results collapse to a single row, sometimes the first category specified, sometimes not. I need to use specific ranges that vary in size, so collapsing the variable in the query specifications is not an option for me. I am filtering using statefip(25),puma(03200,0506),gqtype(0),pernum(1). Suggestions?

---

<div class="post-metadata">

**Author:** ![grover](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.ipums.org/grover/32/5_2.png) [@grover](https://forum.ipums.org/u/grover)\
**Post date:** [August 5, 2014, 5:31pm UTC](https://forum.ipums.org/t/hhincome-recodes-eg-camb-hhinc1-acs-2010-2-not-working-query-collapses-to-a-single-row/599/2 "2014-08-05T17:31:00Z")

</div>

Another option would be to produce the ranges on the query line using the ‘r:’ to define groups. Based on camb\_hhinc1 this would look like hhincome(r: 0-18900; 18910-20550; 20551-23500; 23501-26450). More information on recoding variables on the query line can be found in the help text [here](https://sda.usa.ipums.org/helpfiles/helpan.htm#recode).

I hope this helps.

---

<div class="post-metadata">

**Author:** ![Cliff](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@Cliff](https://forum.ipums.org/u/Cliff)\
**Post date:** [August 6, 2014, 1:47pm UTC](https://forum.ipums.org/t/hhincome-recodes-eg-camb-hhinc1-acs-2010-2-not-working-query-collapses-to-a-single-row/599/3 "2014-08-06T13:47:00Z")

</div>

The staff answer from Joe Grover certainly works.

I was able to to determine the source of my problem The top and bottom ranges in my original recode were hard wired to specific values. When I rerwote these ranges using a wildcard (\*) as the topmost and bottommost values ( eg \*-100 instead of 0-100) the query worked properly. I don’t find any mention of this in the user documentation, which as written seems to imply that any values not explicitly incldued in a recoded range are placed in an MD category:

" Convert to the system missing-data code

If there are no user-specified missing-data codes, and if the option to assign the value of an input variable was not selected, the system missing-data code will be assigned to the new variable for that case
