Page 1 of 1

Hiding/ showing value set

Posted: January 14th, 2019, 1:07 am
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.

Re: Hiding/ showing value set

Posted: January 14th, 2019, 5:40 pm
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));

Re: Hiding/ showing value set

Posted: January 16th, 2019, 1:35 am
by Socio
Dear Aaron

Thank you for your timely reply.
Is there another way too?

Re: Hiding/ showing value set

Posted: January 16th, 2019, 5:17 pm
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.