Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

1 Solution

Accepted Solutions
Not applicable
Author

The relevant part of your request parameters are

      "countOfCategory": {

        "qValueExpression": "=COUNT(CategoryName)"

      },

This will result in a layout looking something like

      "countOfCategory": 243,

View solution in original post

4 Replies
Not applicable
Author

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
Author

Thanks,

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

Not applicable
Author

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
Author

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