Sum total the EMI automatically once it is selected from a select multiple question

Hi @Kal_Lam

I am trying to build a form where data collector is going to collect emi from group of customer,

when he will search the group id we want that the list of the group member should be reflected ( Its done )

after that he need to select the members who paid emi ( Done )
then on the next page not paid ( not selected ) members will be listed ( Not Done )

then we want to show the Total Amount paid and total Amount not paid for verification in note

please help , i am stuck in this ,

enclosed is the sample form and file to upload for your kind reference

list.csv (179 Bytes)
search.xls (67 KB)

Cheers !

Neeraj

Maybe i would do the same thing as outlined in the image shared below:

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo:

Reference xlsform:

Sum.xlsx (11.8 KB)

Hi @Kal_Lam

I think you missed the group concept which need to be selected to get the member data

Further as the members will not be fixed and they may be in ‘n’ numbers

We need some other forumula in calculations , as members name and count will be constant

Also we need to save the selected members for further reference

Pl Guide

In this case, maybe you could do it as outlined in the image below:

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo:

Reference xlsform:

Sum.xlsx (12.3 KB)

hi @Kal_Lam

Thank you for looking again in to this , but as i can see the solution seems to be tough one as the groups and members keeps on changes weekly basis and the members are more than 50000.

can we opt for some easy approach ?
May be via excel upload which we have on weekly basis , also please guide how can we save members who had not paid emi for follow up as saving only numbers will not met purpose.

Cheers !

Neeraj

Hi @caneeraj
On this particular one, you may need to make this using external_csv file as explained in the following articles

There are two approaches we have tested for the different data collection methods (using the android collect application and using Enketo webform).

Approach 1: Using search () in the appearance column.
NOTE:

  1. This method will only work on the android collect application. The original writeup can be found here (https://xlsform.org/en/#dynamic-selects-from-pre-loaded-data).
  2. This method does not need you to execute choice_filter for cascade questions since this is done using one of the search functions i.e. matches (see below)

Step 1: In the XLSForm, within the survey sheet, specify select_one listname or select_multiple listname in the type column (where listname is the name of your choice list) as you would normally do when defining a select_one or select_multiple respectively.

image

Step 2: On the appearance column (survey sheet), define the search function as you would desire.
There are five ways you can use the search function:
• contains- this will check and return all the items in the csv column you need but only for rows in which the filtration column contains the specified parameter within any part of the text in the filtration column.
• beginswith- this will check and return all the items in the csv column you need but only for rows in which the filtration column beginswith with the specified parameter.
• endswith- this will check and return all the items in the csv column you need but only for rows which the filtration column endswith with the specified parameter.
• matches- this will check and return all the items in the csv column you need but only for rows in which the filtration column matches the specified parameter in full to the specified parameter.
• You can also use search without any of the four elements, in this case, you will have the entire list without any filtration applied.

Please note for this example, we are using the “matches” approach and the search without any additional function.

  • You will define your search in the column as follows:
  • search (‘nameofcsv’, ‘matches’, ‘filtercolumnincsv’, ${questionnameinxlsform})
    image

In this example, we are using a csvfile known as countriesbyregion to get various lists.

To understand the example, see the structure of the used CSV file.

countriesbyregion.csv (36.9 KB)

If you need to use any other appearance style such as minimal, you will need to define it before the search appearance followed by a space e.g. minimal search () or minimal autocomplete search ()

Step 3: On the choices sheet of your XLSForm, you will need to define how your list will be built from the csv file:
• list_name column: specify the name of your choice list as you normally would.
• name column: include the name of the .csv column to use for uniquely identifying selected choices.
• label column: include the name of the .csv column to use for labelling the choices.
Note: If you wish to include multiple columns in the labels, include a comma-separated list of all columns to include. The name column will be dynamically populated based on the column name you put there, and the label column will be dynamically populated based on the column name(s) you put there.
• In your choices worksheet row, you may also include a .csv column name in the image column. If you do, the image filename to use will be pulled from the specified .csv column.
Note: If you refer to image files in this way, you must always upload those image files as media file attachments when you upload your form to the server.

Using our example, the definition in the choices sheets will be as the earlier CSV)

Note:

  1. The contents of the columns within the csv that will provide the contents of the name, must meet all the requirements of creating a name in the XLSForm choices sheet.
  2. If you need to pull the label for multiple languages, you can still specify the column that provides them using the same approach above.

Step 4: Upload and deploy your XLSForm as normal. Then upload the csv within the media section as shown below

Select One and Multiple from CSV.xlsx (12.2 KB)

The second approach is explained within our article here https://support.kobotoolbox.org/external_file.html

1 Like