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
  • 0
    Certified Senior Developer
    in reply to manjit.1486

    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}INN Status',
                          filters: a!queryLogicalExpression(
                            operator: "AND",
                            filters: {
                              a!queryFilter(
                                field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}INN Status.fields.{status}status',
                                operator: "=",
                                value: "Q1"
                              ),
                            },
                            ignoreFiltersWithEmptyValues: true
                          )
                           
                        ),
                        config: a!columnChartConfig(
                          primaryGrouping: a!grouping(
                            field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}INN Status.fields.{status}status',
                            alias: "status_primaryGrouping"
                          ),
                          secondaryGrouping: a!grouping(
                            field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}INN Status.fields.{stage}stage',
                            alias: "stage_secondaryGrouping"
                          ),
                          measures: {
                            a!measure(
                              function: "COUNT",
                              field: 'recordType!{6f02251f-0cbb-40a2-881d-0a6bd9983952}INN Status.fields.{id}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"
              )
            }
          )
        }
      )
    )

    Hi.. Can you please guide where do I need to modify the variables?