Page 1 of 1

create value set from external data file

Posted: September 29th, 2020, 3:39 am
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..

Re: create value set from external data file

Posted: September 29th, 2020, 8:30 am
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.

Re: create value set from external data file

Posted: October 3rd, 2020, 8:44 am
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...

Re: create value set from external data file

Posted: October 5th, 2020, 9:13 am
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.

Re: create value set from external data file

Posted: October 6th, 2020, 3:54 am
by manishcspro
Have sent the application folder. Run splitmenu.pff file to start the application.