Elsevier Macro: Collapse duplicate titles into single rows

[
  {
    "op": "core/column-move",
    "description": "Move column title.identifier.elsevier to position 0",
    "columnName": "title.identifier.elsevier",
    "index": 0
  },
  {
    "op": "core/row-reorder",
    "description": "Reorder rows",
    "mode": "record-based",
    "sorting": {
      "criteria": [
        {
          "reverse": false,
          "caseSensitive": false,
          "column": "title.identifier.elsevier",
          "valueType": "string",
          "blankPosition": 2,
          "errorPosition": 1
        },
        {
          "reverse": false,
          "column": "DateFirstPackageIssue",
          "valueType": "date",
          "blankPosition": 2,
          "errorPosition": 1
        }
      ]
    }
  },
  {
    "op": "core/blank-down",
    "description": "Blank down cells in column title.identifier.elsevier",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "title.identifier.elsevier"
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column DateLastPackageIssue using expression grel:if(isBlank(value),\"Not Stated\",value)",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "DateLastPackageIssue",
    "expression": "grel:if(isBlank(value),\"Not Stated\",value)",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column VolumeLastPackageIssue using expression grel:if(isBlank(value),\"Not Stated\",value)",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "VolumeLastPackageIssue",
    "expression": "grel:if(isBlank(value),\"Not Stated\",value)",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column NumberLastPackageIssue using expression grel:if(isBlank(value),\"Not Stated\",value)",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "NumberLastPackageIssue",
    "expression": "grel:if(isBlank(value),\"Not Stated\",value)",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/column-addition",
    "description": "Create column Last Issue Statement at index 8 based on column DateLastPackageIssue using expression grel:value+\",\"+if(isNonBlank(cells.VolumeLastPackageIssue.value),cells.VolumeLastPackageIssue.value,\"\")+\",\"+if(isNonBlank(cells.NumberLastPackageIssue.value),cells.NumberLastPackageIssue.value,\"\")",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "newColumnName": "Last Issue Statement",
    "columnInsertIndex": 8,
    "baseColumnName": "DateLastPackageIssue",
    "expression": "grel:value+\",\"+if(isNonBlank(cells.VolumeLastPackageIssue.value),cells.VolumeLastPackageIssue.value,\"\")+\",\"+if(isNonBlank(cells.NumberLastPackageIssue.value),cells.NumberLastPackageIssue.value,\"\")",
    "onError": "keep-original"
  },
  {
    "op": "core/multivalued-cell-join",
    "description": "Join multi-valued cells in column Last Issue Statement",
    "columnName": "Last Issue Statement",
    "keyColumnName": "title.identifier.elsevier",
    "separator": "|"
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column Last Issue Statement using expression grel:with(value.split(\"|\").sort(),a,a[a.length()-1])",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "Last Issue Statement",
    "expression": "grel:with(value.split(\"|\").sort(),a,a[a.length()-1])",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column Last Issue Statement using expression grel:value.replace(\"Not Stated\",\"\")",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "Last Issue Statement",
    "expression": "grel:value.replace(\"Not Stated\",\"\")",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/column-split",
    "description": "Split column Last Issue Statement by separator",
    "engineConfig": {
      "facets": [],
      "mode": "record-based"
    },
    "columnName": "Last Issue Statement",
    "guessCellType": true,
    "removeOriginalColumn": true,
    "mode": "separator",
    "separator": ",",
    "regex": false,
    "maxColumns": 0
  },
  {
    "op": "core/column-removal",
    "description": "Remove column DateLastPackageIssue",
    "columnName": "DateLastPackageIssue"
  },
  {
    "op": "core/column-removal",
    "description": "Remove column VolumeLastPackageIssue",
    "columnName": "VolumeLastPackageIssue"
  },
  {
    "op": "core/column-removal",
    "description": "Remove column NumberLastPackageIssue",
    "columnName": "NumberLastPackageIssue"
  },
  {
    "op": "core/column-rename",
    "description": "Rename column Last Issue Statement 1 to DateLastPackageIssue",
    "oldColumnName": "Last Issue Statement 1",
    "newColumnName": "DateLastPackageIssue"
  },
  {
    "op": "core/column-rename",
    "description": "Rename column Last Issue Statement 2 to VolumeLastPackageIssue",
    "oldColumnName": "Last Issue Statement 2",
    "newColumnName": "VolumeLastPackageIssue"
  },
  {
    "op": "core/column-rename",
    "description": "Rename column Last Issue Statement 3 to NumberLastPackageIssue",
    "oldColumnName": "Last Issue Statement 3",
    "newColumnName": "NumberLastPackageIssue"
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column DateLastPackageIssue using expression grel:if(length(value)==4,(inc(inc(toDate(value),1,\"year\"),-1,\"day\")),value)",
    "engineConfig": {
      "mode": "row-based",
      "facets": []
    },
    "columnName": "DateLastPackageIssue",
    "expression": "grel:if(length(value)==4,(inc(inc(toDate(toString(value)),1,\"year\"),-1,\"day\")),value)",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column DateLastPackageIssue using expression grel:if(length(value)==7,(inc(inc(toDate(value),1,\"month\"),-1,\"day\")),value)",
    "engineConfig": {
      "mode": "row-based",
      "facets": []
    },
    "columnName": "DateLastPackageIssue",
    "expression": "grel:if(length(value)==7,(inc(inc(toDate(value),1,\"month\"),-1,\"day\")),value)",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column DateLastPackageIssue using expression grel:if(length(value)==10,toDate(value),value)",
    "engineConfig": {
      "mode": "row-based",
      "facets": []
    },
    "columnName": "DateLastPackageIssue",
    "expression": "grel:if(length(value)==10,toDate(value),value)",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column VolumeLastPackageIssue using expression grel:value.toString()",
    "engineConfig": {
      "mode": "record-based",
      "facets": []
    },
    "columnName": "VolumeLastPackageIssue",
    "expression": "grel:value.toString()",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/text-transform",
    "description": "Text transform on cells in column NumberLastPackageIssue using expression grel:value.toString()",
    "engineConfig": {
      "mode": "record-based",
      "facets": []
    },
    "columnName": "NumberLastPackageIssue",
    "expression": "grel:value.toString()",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10
  },
  {
    "op": "core/row-removal",
    "description": "Remove rows",
    "engineConfig": {
      "mode": "row-based",
      "facets": [
        {
          "omitError": false,
          "expression": "isBlank(value)",
          "selectBlank": false,
          "invert": false,
          "selectError": false,
          "selection": [
            {
              "v": {
                "v": true,
                "l": "true"
              }
            }
          ],
          "name": "title.identifier.elsevier",
          "omitBlank": false,
          "type": "list",
          "columnName": "title.identifier.elsevier"
        }
      ]
    }
  }
]

 

 

 

Operated as a Community Resource by the Open Library Foundation