Lookup [Solved]

Discussions about CSEntry
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Lookup

Post by arkagwa »

Dear josh

I will try to check but in UG FORM i have .pen and .pff files updated versions
In UG LOOKUP there two files .dcf and .dat files
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Lookup

Post by arkagwa »

Dear Josh

Please try on any android device for me still does not work. I have attached the file for testing
UG FORM.zip
(53.96 KiB) Downloaded 301 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Lookup

Post by josh »

The problem is that you are using "set attributes assisted (responses)" to show the value sets on Windows. This is a really old feature that we don't use anymore and it does not work on Android. The correct way to do this is to set the capture type on the field to "Radio button". You can do this by right clicking on the field and choosing field properties and then picking "Radio button" under "Capture type".
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Lookup

Post by arkagwa »

Dear Josh

Course codes and Title are alpha/string variable they can't be radio button. If i disable "set attributes assisted (responses)" nothing is shown in value sets on Windows hence difficult to load course codes and titles.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Lookup

Post by josh »

I made course code a radio button and removed the set attributes and it worked for me on both Windows and Android.
Yana
Posts: 51
Joined: October 6th, 2016, 6:57 am

Re: Lookup

Post by Yana »

__________________________
Dear Josh
When the above example application is very helpful. But my question is in the listing app there aren't included in the main questionnaire for example in my application the listing is all households with under five children and the main questionnaire targeted on only households with under five and that child has common childhood illness in the past two weeks. So how to filter these households when we display list of households in the CHOOSE_HOUSEHOLD variable in the menu in your example application.
Thanks
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Lookup

Post by josh »

Next time please post to a new topic rather than adding to a question that has already been answered.

To display only the households that meet a certain condition (such as those with illness in last two weeks) you would just add an if statement inside the while loop. This if statement filters out the households that do not meet the condition.
while loadcase(LISTING_DICT) do
   
if ILLNESS_IN_LAST_TWO_WEEKS = 1 then
        
// Values are household ids concatenated together
        codesString(nextEntry)=maketext("%d%02d%03d%d%03d",
               LI_PROVINCE, LI_DISTRICT, LI_ENUMERATION_AREA,
               LI_AREA_TYPE, LI_HOUSEHOLD_NUMBER);

        
// Labels have househould number and name of head
        labels(nextEntry) = maketext("%03d: (%s)", LI_HOUSEHOLD_NUMBER,
        
strip(LI_NAME_OF_HEAD_OF_HOUSEHOLD));

        nextEntry = nextEntry +
1;
   
endif;
enddo;
This assumes you have a variable named ILLNESS_IN_LAST_TWO_WEEKS in your listing dictionary.
Yana
Posts: 51
Joined: October 6th, 2016, 6:57 am

Re: Lookup

Post by Yana »

Thanks Josh
Locked