Option/value heading

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
milisahu
Posts: 8
Joined: August 17th, 2021, 12:42 pm

Option/value heading

Post by milisahu »

Hi Team,
I am facing a challenge to show option/value with heading could you please anyone help me out for this? for better understanding please look at into below question and options. i have both single and multiple questions like this and i want to show as it's below heading and then option.

thanks in advance for you help!!

Q1- Some women are unable to go for 4 ANC visits. In your opinion, what are the common reasons for it?
Options are -:

WOMEN: INDIVIDUAL LEVEL
She was feeling fine/no problem.....1
Her previous pregnancies were ok with less visits....2
Did not know 4 ANCs were needed ......3

ACCESS RELATED(Heading)
Too far/no transportation.......4
She could not afford transportation......5

FACILITY LEVEL(Heading)
She experienced inadequate services with previous pregnancy......6
Loss of earnings due to ANC visits....7
No one to accompany her........8
No incentive for completion of full ANC.......9
Poor hygiene at the facility.......10
Long waiting time at the facility........11

FAMILY LEVEL(Heading)
Due to her family responsibilities......12
Husband/mother-in-law did not allow her......13
It costs money for these check-ups.......14
Cannot say.........98
Other (specify)__________.......88
Refused to answer.......99
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Option/value heading

Post by sherrell »

Have you explored using the accept function?

https://www.csprousers.org/help/CSPro/a ... ction.html

That should be able to do what you want.

Sherrell
milisahu
Posts: 8
Joined: August 17th, 2021, 12:42 pm

Re: Option/value heading

Post by milisahu »

thank you for your reply accept function will not work for this.

as mentioned above i have 9 option total with 3 separate category and i want to show in same screen 9 option with 3 heading(category). sending question in below for better understanding

please share if anyone have any solution for this thanks!
Screenshot 2021-09-23 18.12.50.png
Screenshot 2021-09-23 18.12.50.png (41.95 KiB) Viewed 2395 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Option/value heading

Post by Gregory Martin »

Having value set headings is a commonly-requested feature that we have not implemented yet. What people tend to do is add them to the value set with codes that will be rejected. For example:

ALBUM | -9
Moon Baby | 01
Whatever | 02
Keep Away | 03
PROC FAVORITE_SONG

   
if FAVORITE_SONG = -9 then
        errmsg
("You cannot select a heading.");
       
reenter;
   
endif;
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Option/value heading

Post by sherrell »

As Greg mentioned, you can't do this right now via value sets. However, this can be done with an accept statement as follows:
PROC ANC_VISIT
preproc
   numeric
i=0;
   
do until i in 2:4,6:7,9:14,16:21

     
i = accept("ANC non-visit reason:",
               
"WOMEN: INDIVIDUAL LEVEL",              // response 1--don't want
               
"  She was feeling fine/no problem",    // response 2--want
               
"  Her previous pregnancies were ok with less visits",  // response 3--want
               
"  Did not know 4 ANCs were needed",    // response 4--want
               
"ACCESS RELATED",                       // response 5--don't want
               
"  Too far/no transportation",          // response 6--want
               
"  She could not afford transportation",
               
"FACILITY LEVEL",
               
"  She experienced inadequate services with previous pregnancy",
               
"  Loss of earnings due to ANC visits",
               
"  No one to accompany her",
               
"  No incentive for completion of full ANC",
               
"  Poor hygiene at the facility",
               
"  Long waiting time at the facility",
               
"FAMILY LEVEL",
               
"  Due to her family responsibilities",
               
"  Husband/mother-in-law did not allow her",
               
"  It costs money for these check-ups",
               
"  Cannot say",
               
"  Other (specify)",
               
"  Refused to answer" );

   
enddo;

       
if i in  2:4  then $ = i-1; // 1-3
   
elseif i in  6:7  then $ = i-2; // 4-5
   
elseif i in  9:14 then $ = i-3; // 6-11
   
elseif i in 16:18 then $ = i-4; // 12-14
   
elseif i = 19     then $ = 98;
   
elseif i = 20     then $ = 88;
   
elseif i = 21     then $ = 99;
   
endif;

   
noinput;
Sherrell
Post Reply