Page 2 of 3

Re: dynamic value set from single response to multiple response

Posted: October 5th, 2019, 9:30 am
by aaronw
@htuser the issue was with my implementation in the application (not CSPro)

Re: dynamic value set from single response to multiple response

Posted: October 5th, 2019, 9:37 am
by aaronw
Here are a few variations using dynamic value sets.

Re: dynamic value set from single response to multiple response

Posted: October 5th, 2019, 11:38 am
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,

Re: dynamic value set from single response to multiple response

Posted: October 7th, 2019, 4:00 pm
by aaronw
No dynamic value sets will be not written to the dictionary.

Re: dynamic value set from single response to multiple response

Posted: October 7th, 2019, 5:34 pm
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,

Re: dynamic value set from single response to multiple response

Posted: October 8th, 2019, 4:31 pm
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"

Re: dynamic value set from single response to multiple response

Posted: October 8th, 2019, 5:18 pm
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.

Re: dynamic value set from single response to multiple response

Posted: October 17th, 2019, 6:13 am
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.

Re: dynamic value set from single response to multiple response

Posted: October 17th, 2019, 9:03 am
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.

Re: dynamic value set from single response to multiple response

Posted: October 17th, 2019, 9:19 am
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,