a!columnChartField( label: "Année", labelPosition: "JUSTIFIED", categories: a!forEach( items: local!periodes[local!selectedPeriod].weeks.week, expression: "S" & fv!item ), series: a!forEach( items: local!uPerWeekPeriode, expression: a!localVariables( local!cBrandId: fv!item.cBrandId, a!chartSeries( label: fv!item.cBrand, data: if( contains(fv!item.cBrandId, ri!selectedUs), fv!item.uPerWeeks, {} ), links: a!forEach( items: local!periodes[local!selectedPeriod].weeks, expression: a!dynamicLink( saveInto: { a!save(ri!filteredYear,tointeger(fv!item.year)), a!save(ri!filteredWeek,fv!item.week), a!save(ri!filteredStatus,cons!STATUT), a!save(ri!filteredCBrand,local!cBrandId), a!save(ri!displayPList,true) } ) ) ) ) ), yAxisMax: local!topAxisUb, stacking: "NONE", showLegend: true, showTooltips: true ),
I wanted to filter the chart to display only "selected Us". In othrer words, only contains" selected Us".
Discussion posts and replies are publicly visible
Is the error referencing a line number in the code? The error itself is simply saying it can't compare two different types of data. You need to cast one (or both)( of them to a common data type before they can be compared. Since you mention 'selected Us' my guess is the error is in Line 15 in your code block above.
line number 15 at function 'contains' [line 15]: Invalid types, can only act on data of the same type (Any Type, Type CDT)
Yup. So as already mentioned:
"The error itself is simply saying it can't compare two different types of data. You need to cast one (or both) of them to a common data type before they can be compared."