function createQuestion(options, callback) {
  cy.createNativeQuestion({
    name: "Count of People by State (SQL)",
    native: {
      query:
        'SELECT "PUBLIC"."PEOPLE"."STATE" AS "STATE", count(*) AS "count" FROM "PUBLIC"."PEOPLE" WHERE 1=1 [[ AND {{city}}]] [[ AND {{state}}]] GROUP BY "PUBLIC"."PEOPLE"."STATE" ORDER BY "count" DESC, "PUBLIC"."PEOPLE"."STATE" ASC',
      "template-tags": {
        city: {
          id: "6b8b10ef-0104-1047-1e1b-2492d5954555",
          name: "city",
          "display-name": "City",
          type: "dimension",
          dimension: ["field", PEOPLE.CITY, null],
          "widget-type": "category",
        },
        state: {
          id: "6b8b10ef-0104-1047-1e1b-2492d5954555",
          name: "state",
          "display-name": "State",
          type: "dimension",
          dimension: ["field", PEOPLE.STATE, null],
          "widget-type": "category",
        },
      },
    },
    display: "bar",
  }).then(({ body: { id: questionId } }) => {
    callback(questionId);
  });
}
// Create a native SQL question with two parameters for city and state.
Create a native SQL question with two parameters for city and state.
Create a native SQL question with two parameters for city and state .
function createQuestion(options, callback) {
  cy.createNativeQuestion({
    name: "Count of People by State (SQL)",
    native: {
      query:
        'SELECT "PUBLIC"."PEOPLE"."STATE" AS "STATE", count(*) AS "count" FROM "PUBLIC"."PEOPLE" WHERE 1=1 [[ AND {{city}}]] [[ AND {{state}}]] GROUP BY "PUBLIC"."PEOPLE"."STATE" ORDER BY "count" DESC, "PUBLIC"."PEOPLE"."STATE" ASC',
      "template-tags": {
        city: {
          id: "6b8b10ef-0104-1047-1e1b-2492d5954555",
          name: "city",
          "display-name": "City",
          type: "dimension",
          dimension: ["field", PEOPLE.CITY, null],
          "widget-type": "category",
        },
        state: {
          id: "6b8b10ef-0104-1047-1e1b-2492d5954555",
          name: "state",
          "display-name": "State",
          type: "dimension",
          dimension: ["field", PEOPLE.STATE, null],
          "widget-type": "category",
        },
      },
    },
    display: "bar",
  }).then(({ body: { id: questionId } }) => {
    callback(questionId);
  });
}
function createQuestion ( options , callback ) { cy . createNativeQuestion ( { name : "Count of People by State (SQL)" , native : { query : 'SELECT "PUBLIC"."PEOPLE"."STATE" AS "STATE", count(*) AS "count" FROM "PUBLIC"."PEOPLE" WHERE 1=1 [[ AND {{city}}]] [[ AND {{state}}]] GROUP BY "PUBLIC"."PEOPLE"."STATE" ORDER BY "count" DESC, "PUBLIC"."PEOPLE"."STATE" ASC' , "template-tags" : { city : { id : "6b8b10ef-0104-1047-1e1b-2492d5954555" , name : "city" , "display-name" : "City" , type : "dimension" , dimension : [ "field" , PEOPLE . CITY , null ] , "widget-type" : "category" , } , state : { id : "6b8b10ef-0104-1047-1e1b-2492d5954555" , name : "state" , "display-name" : "State" , type : "dimension" , dimension : [ "field" , PEOPLE . STATE , null ] , "widget-type" : "category" , } , } , } , display : "bar" , } ) . then ( ( { body : { id : questionId } } ) => { callback ( questionId ) ; } ) ; }
Create a native SQL question with two parameters for city and state.
Create a native SQL question with two parameters for city and state .