Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Engine API - ValueExpression

Hi everyone,

My aim is to evaluate a number of expressions, hopefully as a single call, using the Engine API and Web socket requests from a web browser.   I have a couple of questions.

Referring to this:

https://help.qlik.com/sense/en-us/developer/index.html#../Subsystems/Qlik_Engine_API/Content/Generic...

I see that the aim is to evaluate the expression =Count(CategoryName)

So why does the example's request parameter contain a reference to qFieldDefs (country) and so on? I've managed to reduce the parameter to:

{

  "jsonrpc": "2.0",

  "id": 1,

  "method": "CreateSessionObject",

  "handle": 1,

  "params": [

    {

      "meta": {

        "data": "this is the data",

        "qValueExpression": "=COUNT(CategoryName)"

      },

      "qInfo": {

        "qId": "",

        "qType": "Listbox"

      },

      "qListObjectDef": {

        "qInitialDataFetch": [

          {

            "qTop": 0,

            "qLeft": 1,

            "qHeight": 1,

            "qWidth": 1

          }

        ]

      }

    }

  ]

}

and get the result I want.  Can anyone explain why the additional parameters are present in the example? They seem to me to be extraneous.

Also, can I evaluate multiple expressions with a single call?

Thanks for your help.

Cheers,

Shane.

Message was edited by: Shane Porter Changed request since it wasn't valid.

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: Engine API - ValueExpression

The relevant part of your request parameters are

      "countOfCategory": {

        "qValueExpression": "=COUNT(CategoryName)"

      },

This will result in a layout looking something like

      "countOfCategory": 243,

4 Replies
Not applicable

Re: Engine API - ValueExpression

The relevant part of your request parameters are

      "countOfCategory": {

        "qValueExpression": "=COUNT(CategoryName)"

      },

This will result in a layout looking something like

      "countOfCategory": 243,

Not applicable

Re: Engine API - ValueExpression

Thanks,

any way I can 'ask' for multiple expressions with a single request?

Not applicable

Re: Engine API - ValueExpression

Yes, just append them all in the same manner.

      "countOfCategory1": {

        "qValueExpression": "=COUNT(CategoryName)"

      },

      "countOfCategory2": {

        "qValueExpression": "=COUNT(CategoryName)"

      },

      "countOfCategory3": {

        "qValueExpression": "=COUNT(CategoryName)"

      },

This will result in a layout looking something like

      "countOfCategory1": 243,

      "countOfCategory2": 243,

      "countOfCategory3": 243,

Not applicable

Re: Engine API - ValueExpression

Great.  I thought I'd tried that, but obviously not