Hello Sir,
I needed an help.
I have a table like the file's attached.
I want to put in column "Expensive total" the somme of "expensive 1", "expensive 2", "expensive 3", ..., "expensive 8".
Also, i would like that if medecine (i)="", to skip to "Type of patient".
Is there somebody to help me to get this logic code?
Thank everybody for your eventual helps.
Help for logic code
-
- Posts: 3
- Joined: July 23rd, 2016, 2:22 pm
Help for logic code
- Attachments
-
- Essay.7z
- (4.73 KiB) Downloaded 288 times
Re: Help for logic code
To compute a sum you can just add the variables together:
EXPENSIVE_TOTAL = EXPENSIVE_1 + EXPENSIVE_2 + EXPENSIVE_3 ....
You can do this in the preproc of EXPENSIVE_TOTAL
For the skip you just need to use the skip command and and if then else expression. The only tricky part is that you need to use strip to remove the padding (the extra spaces) since alpha values in CSPro are fixed length.
EXPENSIVE_TOTAL = EXPENSIVE_1 + EXPENSIVE_2 + EXPENSIVE_3 ....
You can do this in the preproc of EXPENSIVE_TOTAL
For the skip you just need to use the skip command and and if then else expression. The only tricky part is that you need to use strip to remove the padding (the extra spaces) since alpha values in CSPro are fixed length.
if strip(MEDECINE_1) = "" then
skip to TYPE_OF_PATIENT;
endif;
skip to TYPE_OF_PATIENT;
endif;
-
- Posts: 1
- Joined: February 20th, 2018, 8:49 am
Re: Help for logic code
Hello,
I'm creating my application but I'm hooked on a display instruction.
for Q1 the answer is either 1 = yes or 2 = no, Q2 is 1 = yes or 2 = no, Q3 is 1 = yes and 2 = no
so, I would like that at the level of Q4 only the labels that received 1 could appear.
I'm creating my application but I'm hooked on a display instruction.
for Q1 the answer is either 1 = yes or 2 = no, Q2 is 1 = yes or 2 = no, Q3 is 1 = yes and 2 = no
so, I would like that at the level of Q4 only the labels that received 1 could appear.
Re: Help for logic code
Next time please create a new post instead of replying to an unrelated topic.
What you want to do is commonly referred to as "dynamic value set" in CSPro. The function to use is called setvalueset(). You can look in the help for info on that function. You can also search this forum for "setvalueset" and "dynamic value set" to see related questions.
What you want to do is commonly referred to as "dynamic value set" in CSPro. The function to use is called setvalueset(). You can look in the help for info on that function. You can also search this forum for "setvalueset" and "dynamic value set" to see related questions.