Concatenate or prefill function problem

Discussions about CSEntry
Post Reply
realturay
Posts: 8
Joined: July 25th, 2023, 12:39 am

Concatenate or prefill function problem

Post 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
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Concatenate or prefill function problem

Post 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.
realturay
Posts: 8
Joined: July 25th, 2023, 12:39 am

Re: Concatenate or prefill function problem

Post 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
Arjun Brti
Posts: 49
Joined: October 15th, 2020, 3:40 am

Re: Concatenate or prefill function problem

Post by Arjun Brti »

Is your EIN variable numeric or string. If it is numeric convert it to string. Than try using this logic.
Post Reply