-
Notifications
You must be signed in to change notification settings - Fork 0
/
41300-roundtripping.rmd
65 lines (43 loc) · 4.74 KB
/
41300-roundtripping.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Appending and fixing data ("roundtripping"){#xroundtripping}
Rather than providing a complicated interface for manipulating and adding data, Causal Map lets you upload data from an Excel file, download it again, make changes or add data and upload it again.
### General principles{#import-general-principles}
The 5 core data tables in any Causal Map file are these: `factors`, `links`, `statements`, `sources`, `questions`.
- The downloaded file has these 5 main worksheets (as well as worksheets to show all the data for the current view when you downloaded the file including filtered fields.)
- All 5 standard tables can also have arbitrary additional columns/fields which users can use e.g. to filter, analyse their data.
You can upload your data back into a new or existing Causal Map file.
- The app will read any worksheet with any of the (lowercase) names of the core tables: `factors`, `links`, `statements`, `sources`, `questions` and will ignore other worksheets.
- If any of these five worksheets in your Excel file are *empty*, the app will **delete all the data** in the corresponding tables.
- If any of the five worksheets are completely **missing** (e.g. you deleted them), when you upload, the app will just keep the old data in the target file.
- If you want to append data, just download the old file, add the rows you want in any of the tables, and upload again. (Adding additional *links* is a special case, see [xx](). )
### Downloading a file
To download a file click the download icon in the left panel and your data will be downloaded as an xlsx.
![dVHQQ2ZsUl](_assets/dVHQQ2ZsUl.gif)
What you can expect from your download:
- Factors table: the `factor_id` field is included.
- If you delete any of the rows, any links pointing to them will be deleted on upload.
- If you want to add more factors at the bottom of the table, leave the `factor_id` field blank for those rows and the app will add them on upload.
- Links table: the `link_id` field is not included and is not needed.
- Statements table: the `statement_id` field is not included.
- Don't delete any of the rows, unless you know what you are doing. (You can delete any rows after the currently last coded statement.)
- You can add more statements at the bottom of the table.
- Statements table on our Test server: the `statement_id` field IS included when you download a file.
- You can delete rows and reorder rows (by dragging them around in Excel). Don't change the `statement_id`.
- Note: If you delete rows which had links, these links will become orphaned and will be displayed in the maps only when you do not filter by any `statement_id`. This probably isn't what you want -- you might want to delete the corresponding links too. If you choose to add new rows as well as deleting old rows, the `statement_id` of the new rows will be the row number, so make sure this is what you want -- will they then get "gifted" orphaned links?
- Sources table: the `source_id` field is included.
- You can edit the `source_id`. Keep in mind that the contents of the `source_id` column in this table should match the contents of the `source_id` column in the statements table.
- If you want to add more rows, you must include a `source_id` for each row.
- Questions table: the `question_id` field is included.
- You can edit the `question_id`. Keep in mind that the contents of the `question_id` column in this table should match the contents of the `question_id` column in the statements table.
- If you want to add more rows, you must include a `question_id` for each row.
### Uses for roundtripping
You could download a file to:
1. Make any ordinary trivial edits like changing a name, and/or add ordinary columns/fields.
2. Add rows. Note this does **not** add linked entries in linked tables.
3. Delete rows. Note this does **not** delete linked entries in linked tables (except if you delete factors, any links to/from them will be deleted.)
You could upload a file containing only a statements tab:
1. with a column text and optionally source_id, question_id and maybe other fields. Note this does not add the source and question ids to the source and question tables.
You could upload a file containing only a links tab:
1. With just the from_label and/or to_label columns and no factors tab.
2. With numerical from and to columns which relate to a factors tab which has a factor_id column and a label column and usually a statement_id column.
### What if you have merged cells in your Excel file?
If you have merged cells so e.g. source_id spans many rows, the app will not be able to read this data. It is easy to unmerge your cells without losing your data, just follow the instructions on this [webpage](https://www.extendoffice.com/documents/excel/1139-excel-unmerge-cells-and-fill.html).