Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kavak
Partner - Contributor
Partner - Contributor

Number of requests made to the SSE

Hi there,

I observed the following behaviour. Can someone tell me if this is a known limitation, architectural design, known bug or something else entirely?

I simplified the problem for this forum.

Let’s say I have one SSE function: SSE.Increase, which will increase a given field by 5.

Additionally, my datamodel has one table with 5000 rows and two fields:

my_idmy_number

 

with my_id being a dimension and my_number a measure.

Now, if I build a table in a QlikSense sheet with:

Column-NameTypeValue
Column 1Dimensionmy_id
Column 2MeasureSSE.Increase(my_number)

 

my SSE function will be called once with 5000 rows => high performance.

2nd try: I now change my table to:

Column-NameTypeValue
Column 1Dimensionmy_id
Column 2MeasureSSE.Increase(my_number) + 1

 

This will lead to my SSE function to be called 5000 times with 1 row each => significant decrease in performance.

And lastly, another table:

Column-NameTypeValue
Column 1Dimensionmy_id
Column 2MeasureSSE.Increase(my_number)
Column 3Measure1
Column 4Measure[Column 2] + [Column 3]

 

This time, again, QlikSense will call my SSE function just once with 5000 rows => high performance. This table will lead to the same results as table #2, but with a much better performance (and some additional columns...)

I tested this with the latest Qlik Sense Version.

As I stated in the beginning: Why?

Thanks.

Murat

Labels (4)
1 Solution

Accepted Solutions
Markus-Helgesson
Employee
Employee

Hi,

You have run into a limitation. Nested SSE expressions are currently always evaluated per row. The optimizations which collects the data into a single bundle only kicks in for outer expressions, like SSE.Increase(my_number).

Adding a + 1 may seem like a small thing, but it will prevent this optimization since the SSE call becomes nested. You may not think of it like one, but´+´ is actually a function with some special syntax. The behavior might be clearer if you think of it like Add(SSE.Increase(my_number), 1).

Hopefully further optimizations can be added at some point to handle cases such as this.

I hope this helped, good luck with your future experiments!
Markus Helgesson

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

That's a really interesting observation.  I replicated your observation by testing with https://github.com/RobWunderlich/qcb-qlik-sse function "QCB.SampleScalar(field, 15)" which is a simple test function. Fours rows of data made one call and one data bundle. 

I changed the expression to "QCB.SampleScalar(field, 15) + 1" and that made four calls, one data row per bundle. 

I don't know why this is so, but I'm going to ask around. 

@rbecher @Steven_Pressland any thoughts?

-Rob

rbecher
MVP
MVP

I guess it switches to an aggregation (only wrapped).

Astrato.io Head of R&D
Markus-Helgesson
Employee
Employee

Hi,

You have run into a limitation. Nested SSE expressions are currently always evaluated per row. The optimizations which collects the data into a single bundle only kicks in for outer expressions, like SSE.Increase(my_number).

Adding a + 1 may seem like a small thing, but it will prevent this optimization since the SSE call becomes nested. You may not think of it like one, but´+´ is actually a function with some special syntax. The behavior might be clearer if you think of it like Add(SSE.Increase(my_number), 1).

Hopefully further optimizations can be added at some point to handle cases such as this.

I hope this helped, good luck with your future experiments!
Markus Helgesson