charts - 16.3

Certified Senior Developer

I am trying to implement the stacked column charts using the below example . But somehow ,zeros are populated in the chart instead of count. Looks like code logic in the datapoints is causing this. please let me know if any one have thoughts on this. Thanks

https://forum.appian.com/suite/help/16.3/recipe_aggregate_data_from_a_data_store_entity_by_multiple_fields_and_display_in_a_chart.html

 

Datacode

with(
  local!categories: index(ri!data, ri!categoryField, {}),
  local!labels: index(ri!data, ri!labelField, {}),
  /* Find all datapoints that match both the category and chart series label   `*/
  local!intersection: intersection(
    where(local!categories=cast(typeof(local!categories), ri!category), 0),
    where(local!labels=cast(typeof(local!labels), ri!label), 0)
  ),
  if(
    length(local!intersection)=0,
    /*` If there is no datapoint for this category-label pair, return 0 so that */
    /* all subsequent points are in the correct order with the categories      */
    0,
    index(index(ri!data, ri!datapointField, {}), local!intersection, 0)
  )
)

  Discussion posts and replies are publicly visible