Filter use in Column Chart

Certified Senior Developer

Hello everyone,

Can anyone suggest how we can use userfilter in column chart? I am fetching data from records in column chart. However, filter is not working. Please suggest.

Thanks

  Discussion posts and replies are publicly visible

Parents Reply Children
  • +1
    Certified Senior Developer
    in reply to manjit.1486

    You need to define your code in a {} as you have array of components post the local variable definition

    a!localVariables(
      local!status: "Q1",
      {
        a!dropdownField(
          label: "Status",
          choiceLabels: { "Q1", "Q2", "Q3", "Q4" },
          choiceValues: { "Q1", "Q2", "Q3", "Q4" },
          value: local!status,
          saveInto: local!status,
          placeholder: "Status",
          searchDisplay: "AUTO"
        ),
        a!sectionLayout(
          label: "",
          contents: {
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!boxLayout(
                      label: "Open Status",
                      contents: {
                        a!columnChartField(
                          data: a!recordData(
                            recordType: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}',
                            filters: a!queryLogicalExpression(
                              operator: "AND",
                              filters: {
                                a!queryFilter(
                                  field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}.fields.{status}',
                                  operator: "=",
                                  value: local!status
                                ),
    
                              },
                              ignoreFiltersWithEmptyValues: true
                            )
                          ),
                          config: a!columnChartConfig(
                            primaryGrouping: a!grouping(
                              field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}.fields.{status}',
                              alias: "status_primaryGrouping"
                            ),
                            secondaryGrouping: a!grouping(
                              field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}.fields.{stage}',
                              alias: "stage_secondaryGrouping"
                            ),
                            measures: {
                              a!measure(
                                function: "COUNT",
                                field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}.fields.{id}',
                                alias: "id_count_measure1"
                              )
                            },
                            dataLimit: 100
                          ),
                          label: "",
                          stacking: "NONE",
                          showLegend: true,
                          showDataLabels: true,
                          showTooltips: true,
                          allowDecimalAxisLabels: false,
                          labelPosition: "ABOVE",
                          allowImageDownload: false,
                          colorScheme: a!colorSchemeCustom(
                            colors: {
                              "#00a88f",
                              "#0087ac",
                              "#f7d027",
                              "#6ba547",
                              "#619ed6"
                            }
                          ),
                          height: "MEDIUM",
                          xAxisStyle: "STANDARD",
                          yAxisStyle: "STANDARD",
                          refreshAfter: "RECORD_ACTION"
                        )
                      },
                      style: "STANDARD",
                      marginBelow: "STANDARD"
                    )
                  },
                  width: "8X"
                )
              }
            )
          }
        )
      }
    )

  • 0
    Certified Senior Developer
    in reply to manjit.1486

    Thank you so much. It worked.

  • 0
    Certified Senior Developer
    in reply to manjit.1486

    Great! Do verify the answers which were helpful to you.