dynamic value set from single response to multiple response

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw »

@htuser the issue was with my implementation in the application (not CSPro)
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw »

Here are a few variations using dynamic value sets.
Attachments
single-response.zip
Radio buttons
(2.24 KiB) Downloaded 198 times
multiple-response.zip
Check boxes
(2.37 KiB) Downloaded 225 times
combo.zip
Radio button then check boxes
(2.38 KiB) Downloaded 222 times
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: dynamic value set from single response to multiple response

Post by htuser »

Thank you Aaron.
But since, sometimes i'm using CSPro2SQL, who create tables with dictionary valueset, does, dynamic valuesets object are stored/written in the dictionary?
Please let me know,
Best,
G.VOLNY, a CSProuser from Haiti, since 2004
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw »

No dynamic value sets will be not written to the dictionary.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: dynamic value set from single response to multiple response

Post by htuser »

Thank you Aaron for response.
However having a way to store dynamic value sets list and code, list and index is very important for the labellisation purpose of database or any statistical software. Right now, a workaround for database labellisation will be to use sqlquery() to insert list code and label for value sets, list and index for dynamic response in CSDB as a valueset relational table. But, this table will not sync on CSWeb since it's not related to dictionary and will not used for label when export to SPSS, Stata etc.

So, a solution is to have a way to write dynamic valueset or response, on the fly, to the local dictionary (stored on CSDB) and sync to local dictionary data to CSWeb.

A better solution is welcome from you!

Best,
G.VOLNY, a CSProuser from Haiti, since 2004
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: dynamic value set from single response to multiple response

Post by aaronw »

This response can safely be ignored by most users. With that said, I've outlined my high-level approach.

Each case potentially has a different value set based on the selections made (example in thread). You can use a lookup file to associate each case with the codes and labels of each fields dynamic value sets. I believe this would capture all the information you need and the lookup file could be synchronized. Afterwards, you will need to deconstruct the lookup file and populate your database. Below is a rough approximation of the lookup file I am imagining.

Code: Select all

Case 1
	Field1_Codes - "1,2,3"
	Field1_Labels - "A,B,C"
	Field2_Codes - "1,3"
	Field2_Labels - "A,C"
Case 2
	Field1_Codes - "1,2,3"
	Field1_Labels - "A,B,C"
	Field2_Codes - "2,3"
	Field2_Labels - "B,C"
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: dynamic value set from single response to multiple response

Post by htuser »

Thank you Aaron. This is a better solution thank that i think before.
However, this will not solve globally problem with statistical package label export.
So, we'll be obliged to add dynamic value sets and dynamic response to them manually in the exportation script.

Best Regards,

PS: Dynamic response is different than dynamic value sets. In dynamic response we only use string list label and when a response is chosen,
the list index of this is automatically stored in item as code. So, for label purpose we must store list item and index.
G.VOLNY, a CSProuser from Haiti, since 2004
Win Ko Ko
Posts: 3
Joined: April 23rd, 2019, 8:18 am

Re: dynamic value set from single response to multiple response

Post by Win Ko Ko »

Dear All,

May i know about the control for multiple responses with dynamic value with two digit code.
For example.

Q1 : What color do you know? (Multiple Responses)

10: White
11: Red
12: Green
14: Blue
15: Orange
16: Yellow
17: Gray
18: Pink
19: Black
99: Don't know

Q2 : What color do you like? (Multiple Responses)
10: White
11: Red
12: Green
14: Blue
15: Orange
16: Yellow
17: Gray
18: Pink
19: Black
99: Don't know

In Q2, we want to display color which selected in Q1. Thanks.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: dynamic value set from single response to multiple response

Post by josh »

First, you can avoid two digit codes by using all the characters available: capital letters (A-Z), lowercase letters (a-z), numbers (1-9) and even symbols ($,%,&,#...). With that you can have as many options as you would have with a two digit numeric code.

If you absolutely must use two digit codes see this post: viewtopic.php?f=10&t=2190 that gives the implementation of an ischecked function that can tell you if a two digit code was checked in a multiple response question. In the next version of CSPro the ischecked function will be built in to the language.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: dynamic value set from single response to multiple response

Post by htuser »

Hi Josh,
Thank you for implementing isChecked as a native CSPro function. However, it will be very important also to automatically parse multiple response in subitem Yes(1)/No(0) for each choice.
Please let me know if you already think about this.

Best,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply