create value set from external data file

Discussions about CSEntry
Post Reply
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

create value set from external data file

Post by manishcspro »

I have created a data entry application, It generates a data file in .csdb format.
I have created a reporting application to display report based on data entered in above data entry application.
We have to select the district code from displayed dropdown list to view the particular district's report.
What I want to do is to display the dynamic district list based on the data file.
I have a list of 75 districts in my value set, but I want to show the list of districts which exist in my data file rather list of all 75 districts.
Please guide me..
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: create value set from external data file

Post by josh »

You can use a forcase loop to go through the external data file and build the dynamic value set from the districts you find. Inside the loop, check to see if the district is already in the value set and only add it if it is not there already. To do that you can use

Code: Select all

districtValueSet.codes.seek(district)
. If that returns zero then the district is not in the value set yet.
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: create value set from external data file

Post by manishcspro »

Actually the for loop creates the valueset list as per line number or number of occurrences.
The setvaluset function stores and displays the district list based on all the oocurrences in database. The setvalueset function should store the unique district code. But it was not doing.. perhaps something is going wrong...
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: create value set from external data file

Post by Gregory Martin »

If you want, you can post your code here (or email cspro@lists.census.gov) and we can look at how you're constructing your dynamic value set.
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: create value set from external data file

Post by manishcspro »

Have sent the application folder. Run splitmenu.pff file to start the application.
Post Reply