Filters

Use conditional operators to filter arrays: > , < , >= , <= , =, !=.

Filters example with numbers

Filters should be the same on the ith+1 marker and all other markers if you want to keep only matching rows. Use an Alias to simplify report maintenance.

Data

[
  { name: "John", age: 20 },
  { name: "Eva", age: 18 },
  { name: "Bob", age: 25 },
  { name: "Charly", age: 30 }
];
People

{d[i , age > 19, age < 30].name}

{d[i+1, age > 19, age < 30].name}

Filter example with strings

Filter with strings as shown in the example below.

Data

[
  { name: "Falcon 9", type: "rocket" },
  { name: "Model S", type: "car" },
  { name: "Model 3", type: "car" },
  { name: "Falcon Heavy", type: "rocket" }
];
People

{d[i , type='rocket'].name}

{d[i+1, type='rocket'].name}

Filter with the iterator index

Filter the loop index as shown in the example below.

Data

[
  { name: "Falcon 9" },
  { name: "Model S" },
  { name: "Model 3" },
  { name: "Falcon Heavy" }
];
People

{d[i, i < 2].name}

{d[i+1, i < 2].name}

Last updated