SSE functions

When implementing SSE functions, there are two approaches:

  • Implementing a function that receives a string that contains code and values. Here, the SSE parses the string, evaluates the code, and calculates the answer. An example of this is as follows; we are passing a very simple script that counts customers (count(CustomerID)) and passes this value to R, which will print the value multiplied by 2:
R.ScriptEval('print(q$value*2)',count(CustomerID) as value)
  • Implementing a function that is precompiled and accepts only parameters for a calculation. In the following example, we are aggregating SalesAmmount by Week and using these as parameters, so the function will create a simple linear regression based on those values:
Linear.simple([OrderDate.autoCalendar.Week],sum(SalesAmmount))

Both approaches (using a script from the Qlik side or encapsulating all the code into functions from the server side) have pros and cons, as outlined in the following table. You can decide later which is best suited to your needs:

Script from Qlik side

Encapsulated functions

More flexibility

You can work with two teams: one programming in Qlik and data scientists implementing the models using R, Python, and many others.

All code stays on the same repository

More governance because you can control what models can be exposed to Qlik.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset