SUMMARY ROSTER

Discussions about CSEntry
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: SUMMARY ROSTER

Post by sherrell »

Hi Paul,

[Issue 1] The data file you sent has two cases, both of which are complete. However when I tried to drop into the first case (0010101), CSEntry stops me on form IC1P2 at field PESO_INI1, as no data has been entered, indicating the case is NOT complete. In your logic for PROC R1P112 it checks if R1P112=3 and it skips to R1P114. However, in the PROC PESO_INI1, you have the following logic:
PROC PESO_INI1
preproc
if 
ID_ALIMENTO_MEDIDA <> 'NO EXISTE EN EL LAMINARIO'then
   
PESO_INI1 = ID_PESO
else
   
PESO_INI1 = R1P113
endif;
So either the test is failing and PESO_INI1 is being set to R1P113 which got skipped over and would have no value. or ID_PESO was also blank when it was assigned to PESO_INI1. Either way, since your dictionary does not allow a value of NOTAPPL for PESO_INI1, I'm not sure how you got through entry on this field without a valid value.

[Issue 2]
>I have added the code that you sent, but I have noticed some changes in this regard, before I could
>write directly in the search field and when I hit enter the results that matched the search would
>appear, now after adding the code you must first hit enter to enter to search and filter.

The InAdvance() function was really what I was trying to demonstrate, I didn't mean for it to necessarily be in the layout you wanted, as it depends on what you want to do. To most closely mimic what you were doing before, do this:
PROC BUSCAR1
preproc
if inAdvance
() and length(strip($)) > 0 then
    noinput
;
endif;

postproc
if selcase
("Digite el alimento que busca:", TABLA_DICT,"") <etc>
But if you want to force the selection box to appear as you enter the field, then the selcase call should be in the preproc, and you should do this:
PROC BUSCAR1
preproc
if inAdvance
() and length(strip($)) > 0 then
    noinput
;
else
    if selcase
("Digite el alimento que busca:", TABLA_DICT,"")
      <etc>
   endif;
endif;
[Issue 3] >>> Your current question <<<<

I think you are asking too much of that second repeating record, INC2P1. You could add logic to repeat the fields from the row above when not on row 1, but in your current scenario, you would have to at least enter field R1P101 so you know whether you are entering data for the same ingredient or not. And as you point out, all the information up to field R1P107 must be reentered.

What I would suggest is to create a separate roster for EACH C1P(1-7) item given on form PC1 (the input DCF). Then you could automatically fill the first field, R1P101, for every row, and once they have entered the fields from there to R1P107 on row 1, you can repeat (copy) that data for rows 2-N for all subsequent ingredients. In order to reduce the amount of data fields you're tracking/dealing with (and I'm guessing you'll want to keep the data fields to a minimum for processing/analysis), you'll want to consolidate these food-specific ingredient records into a single record, rather than keeping them spread across 7 records with 10 occurrences each. To do this, save the .csdb file as a .dat file, which will break the connection between the underlying database name and the data fields itself. Then modify the dictionary you have now and use it to reference the .dat file (call it the analysis DCF).

For example, if you allow each C1P(1-7) food to have 10 ingredients, then your input dictionary will have 7 separate IDENTICAL records that have 10 occurrences. Meanwhile your analysis dictionary that will represent the .dat consolidated data file will allow 70 occurrences for the single record INC2P1.

[Issue 4]

On a side note, in both the TABLA_DICT and MC_DE_ALIMENTOS_DICT all but one of the record items (variables) are called "ID_<name>". This hinders review of your application as none of these are ID items, they are just regular dictionary items. If you are using them as a lookup to another dictionary, it would help if they were called something like "LU_ID_<name>", where LU=lookup, so as to clarify your intentions.

Sherrell
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: SUMMARY ROSTER

Post by PHINOJOSA »

Good night sherrell

I appreciate your comments.

Regarding the weight fields, they did have data when entered for the first time but when you partially save and return, as you have already seen, they appear empty.

Please feel free to modify my logic or add code and send me an improved version of the project.

I know that these are things that, due to my inexperience, I cannot understand or solve, but with the help of you and the community I know that it can be solved until the objective is achieved.

Thank you so much
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: SUMMARY ROSTER

Post by sherrell »

>Regarding the weight fields, they did have data when entered for the first time
>but when you partially save and return, as you have already seen, they appear empty.

Neither of the two cases in the data file you provided were partial, which is what I pointed out. For if a case was partial I might have expected this, but since they weren't, I don't know how you got into that state (unless you were reworking skips in that area after the data was entered).

>Please feel free to modify my logic or add code and send me an improved version of the project.

We are a small group and generally do not rewrite users' programs. I have made a few modifications that will allow the first method I suggested to work. There are still other design issues however. For example, you are allowing users to exit the IC1P2 form whenever they want, but you should be checking that they have entered at least one ingredient for each of the food items you've listed on the previous form.

Sherrell
Attachments
R24_3 (smg).zip
(9.41 KiB) Downloaded 1434 times
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: SUMMARY ROSTER

Post by PHINOJOSA »

thank you so much sherrell

I appreciate the time to review and improve the project, it has been very useful to be able to copy data from a previous row in a ROSTER, I feel that there is little left to have the complete project.

Although there are some things to do but little by little they will be done.

If you have more suggestions please I will be attentive.
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: SUMMARY ROSTER

Post by PHINOJOSA »

Hello

I apologize for taking so long to upload the progress I had, first of all thank those who help me keep this project moving forward.

To update you, the application currently consists of two meal times but it could be up to 7, I haven't done that yet to focus on advancing the processes since once achieved the next process works that is repetitive for the following meals.

With the help of Sherrell I have achieved that if the preparation is the same, the common data per preparation is copied within the roster, I have added a combo box at the beginning of each row of the roster so that the preparations entered in (C1P_ROSTER) can be selected and so the text is always the same between each preparation.

I have a problem here. I would like that when changing the preparation, it is to say at the end of the row in the field (C1PI_ROSTER - ADD1) when I select option 3 - next preparation, the preparation that already has all its ingredients is removed from the list.

Aside from that detail. I have a case ID = 0010101, where I have 2 meal times mentioned above (2 roster), and I only need to summarize those 2 rosters as an example that I uploaded in a previous post but now I am uploading the model again.

I have thought about making a summary for each roster for each meal time from 1 to 7, and then summarizing those 7 rosters into a new roster. Or the other option is to summarize all the rosters (C1PI_ROSTER, C2PI_ROSTER, ... C7PI_ROSTER) in a single roster already summarized, I don't know if that is possible.

I hope you can continue helping me to continue advancing the project, I have learned several things but there are things that I cannot achieve without the help of this community.

Thanks again to Sherrell for helping me with being able to copy the common data of the preparations and to Justinlakier who proposed an output for the summary but I have not been able to achieve it.

Feel free to improve the code or add things, I appreciate your time and thank you nothing for everything.
SAMPLE_SUMMARY.xlsx
(15.39 KiB) Downloaded 1688 times
R24_4.rar
(635.58 KiB) Downloaded 1469 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: SUMMARY ROSTER

Post by sherrell »

Hi Paul/Pablo,

>I would like that when changing the preparation, it is to say at the end of the row in the field (C1PI_ROSTER - ADD1)
>when I select option 3 - next preparation, the preparation that already has all its ingredients is removed from the list.

See attached for a slightly revised program that allows that. The logic you had in the PROC C1PI_02 that makes the initial assignment to the value set should really be in the PROC for the roster itself, which is where I've placed it. I've also added logic in the PROC C1PI_02 that removes preparations as you have finished with them--however, then you have a problem if the interviewer backs up--what happens to the list that's now been edited down to nothing? Do you want to reinstate all items when they're at the end of the roster? That will start causing problems. Do you want to force them to the first (keyable) field in the first row and reset the value set to all items?

On a side note, I resized the C1PI_ROSTER so that it fits on a page. It's a bit annoying to work with a roster that scrolls AND a page that scrolls. Ideally only one thing will scroll, and I'm choosing to let the roster scroll.

I'm still not clear on this summary roster you want to have. What is the point of it? Is it something that the interviewer can review and discuss with the respondent to decide whether they need revisit one of the meals to add more foods/food items? In your first post you show a summary screen of sorts, but it is huge, as it seems like you are listing most (all?) fields being entered--are interviewers using tablets where they can scroll across all the data being presented? Even so, I would reduce the size of what you're showing. See the attached as an example.

Sherrell
food report.jpg
food report.jpg (41.36 KiB) Viewed 632945 times
Attachments
R24_4 (smg).zip
(10.4 KiB) Downloaded 1463 times
Last edited by sherrell on December 11th, 2023, 12:37 pm, edited 2 times in total.
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: SUMMARY ROSTER

Post by PHINOJOSA »

Sherrell

Thank you very much for your support.

I think I owe you an explanation of the reason for this project, we want to collect information on all the foods that a person eats the day before, the interviewer after finishing entering all the information should be able to see a summary of everything consumed at the meal level. and preparations to at the end have a calorie report or any other data from the table (TABLA_REC) that contains energy, calories, etc. and based on this report the interviewee will receive a nutrition talk according to their results, for this reason it is important summarize the data at the level of meals and preparations and these tables summarize feed the report so that at the end of the survey the interviewee will benefit from the nutritional talk.

Regarding the end of the ingredients (C1PI_ROSTER - ADD1), when changing preparations, the already finished preparations are eliminated from the list, and it may happen that an ingredient from the first preparation is forgotten. This is something that methodologically can be avoided by asking questions beforehand. to move on to the next preparation.

And with respect to the summary, as I explained it to you in the first paragraph, it has a purpose and I put several variables, as you say it is extensive but it is so that the interviewer has the data at hand in case he has to add any observations at the end of each meal.

Although the summary is extensive, many of the summaries are unique data per row, in others it is count, sum of values and order number.

Since I started the project I have advanced a lot with the help of the community by watching posts, YouTube videos and your support.

I attach a data with 2 cases, 2 meals each with several preparations so that you can use it for the summary.
R24_4_data.rar
(14.63 KiB) Downloaded 1503 times
Thank you so much

If you need any other information, let me know, I will be waiting for your response.
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: SUMMARY ROSTER

Post by sherrell »

Thanks for explaining what you're doing. I'm still not convinced that giving the interviewer this level of information will work, especially if their screen size is limited. The basic question for your report is,

[1] do you want a static report that the interviewer discusses with the respondent, and then the interviewer has to control movement to some place in the CAPI program to correct entries, or

[2] do you want a more dynamic report like a table generated from the accept command where, based on the position of the interviewer, you choose to go to a specific roster/food item that they select?

If you haven't used the accept command, you can see it being used in the Labor Force Survey that comes installed with CSPro:

%UserProfile%\Documents\CSPro\Examples 7.7\1 - Data Entry\Labor Force Survey

Sherrell
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: SUMMARY ROSTER

Post by PHINOJOSA »

Hi Sherrell.

An additional help, as you know, this application will be done on an Android tablet device, and for reasons of agility and fluency of the questions I have grouped some questions into blocks.

But I have found the problem that when they are in blocks, even if I do not enter data, whether it is a numerical or string variable, it advances to the next question. An error only occurs when you want to move between pages or screens. Is there a way that if the field is without data or empty, you cannot advance to the next question within a block?
WhatsApp Image 2023-12-12 at 3.49.08 PM.jpeg
WhatsApp Image 2023-12-12 at 3.49.08 PM.jpeg (13.85 KiB) Viewed 632770 times
WhatsApp Image 2023-12-12 at 4.04.38 PM.jpeg
WhatsApp Image 2023-12-12 at 4.04.38 PM.jpeg (17.42 KiB) Viewed 632770 times


I used this code to not advance with string variables,

postproc
if strip($)="" then
errmsg("Debe registrar el apellido, intente de nuevo");
reenter;
endif;

but I don't know what it would be like with a numerical variable, I have used this code in the variable within the block and it doesn't work, please help.

I have not yet defined your question about the roster summary, it is pending
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: SUMMARY ROSTER

Post by justinlakier »

Hi,

The point of a block is to have the elements appear at the same time, so you are not advancing between them. If you want entering one element to be dependent on a previous element, those two elements cannot be in the same block. You can either separate them or rely on error messages showing up when you move to exit the block.

Hope that helps,
Justin
Post Reply