Hiding/ showing value set

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Socio
Posts: 48
Joined: May 1st, 2017, 4:47 am

Hiding/ showing value set

Post by Socio »

Dear all

Hi, I need a help regarding hiding value set.

I have two district in which many blocks are there.
What I want is if I select first district, in block section only blocks under first district should show up.

Q1. State (value set given-1,2,3)
Q2. District (value set given-1,2,3)
Q3. Block (value set given-1,2,3,4,5,6,7,8)

Thank you.
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Hiding/ showing value set

Post by aaronw »

I recommend hierarchical value sets. This just means you create a value set of blocks for each district. Use the value of district to construct the value set name and dynamically set the value set for the block field. In your example, you had three districts, so blocks would have three value sets (DISTRICT_1_VS, DISTRICT_2_VS, and DISTRICT_3_VS). The logic would look like this:
PROC BLOCK

onfocus

    setvalueset(BLOCK, maketext("DISTRICT_%v_VS", DISTRICT));
Socio
Posts: 48
Joined: May 1st, 2017, 4:47 am

Re: Hiding/ showing value set

Post by Socio »

Dear Aaron

Thank you for your timely reply.
Is there another way too?
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Hiding/ showing value set

Post by aaronw »

The crux of the problem is that the value sets in block depend on the selection of the district. You could solve this in any number of ways. However, I believe hierarchical value sets is a straightforward and complete solution. If anything is unclear let me know.
Post Reply