Page 1 of 1

Concatenate or prefill function problem

Posted: July 25th, 2023, 1:52 am
by realturay
In CSPRo i am building a questionnaire and I have variable i.e. District Code, Chiefdom Code, and Village Code. When I input these codes in this different variables, I want the next variable to contain a combination of all three variable as an ID to that interview

Re: Concatenate or prefill function problem

Posted: July 25th, 2023, 6:33 am
by Gregory Martin
If you are fine with the next variable being a string, you can define it as alpha in the dictionary, and then in the preproc of that field:
PROC FIELD4

preproc

   
FIELD4 = maketext("%v%v%v", FIELD1, FIELD2, FIELD3);
"%v" formats those fields using the formatting parameters defined in the dictionary.

Re: Concatenate or prefill function problem

Posted: July 29th, 2023, 6:21 am
by realturay
Hi Gregory,

I am still having trouble getting this right.

I created a new variable called EIN that I want it to hold these values but it's not working for me

Re: Concatenate or prefill function problem

Posted: August 1st, 2023, 2:58 am
by Arjun Brti
Is your EIN variable numeric or string. If it is numeric convert it to string. Than try using this logic.