carto-vl icon indicating copy to clipboard operation
carto-vl copied to clipboard

CVL 1.4.1 regression :: filtering with list does not work anymore

Open Captain-Oski opened this issue 5 years ago • 1 comments

What is happening :

Filtering viz by passing a filter: $cartodb_id in list([1,2,3,4,5]) send an error as follow :

image

this.viz_highlight.filter.blendTo(s.in(s.prop('id'), s.list(ids))); equivalent to : filter: $cartodb_id in list([1,2,3,4,5]) or filter: $cartodb_id in list[1,2,3,4,5]

How to reproduce :

Just change the CVL version from 1.0.0 to 1.4.1 in the CDN of the example below:

https://jsfiddle.net/captainOski/g72weh0y/1/

Thank you for the good work !

Captain-Oski avatar Sep 11 '19 18:09 Captain-Oski

Just got same error, for the moment I'm dynamically creating an 'or' concatenation for each value, something like:

const floorsString = `and (${floors.includes('0') && `$floor == 0 or` || ''} ${floors.includes('1') && ` $floor == 1 or` || ''} ${floors.includes('2') && ` $floor == 2 or` || ''}`;
setFloorsFilter(`${floorsString.substr(0, floorsString.lastIndexOf('or'))})`);

AdriSolid avatar Oct 14 '19 09:10 AdriSolid