Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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_id | my_number |
with my_id being a dimension and my_number a measure.
Now, if I build a table in a QlikSense sheet with:
Column-Name | Type | Value |
Column 1 | Dimension | my_id |
Column 2 | Measure | SSE.Increase(my_number) |
my SSE function will be called once with 5000 rows => high performance.
2nd try: I now change my table to:
Column-Name | Type | Value |
Column 1 | Dimension | my_id |
Column 2 | Measure | SSE.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-Name | Type | Value |
Column 1 | Dimension | my_id |
Column 2 | Measure | SSE.Increase(my_number) |
Column 3 | Measure | 1 |
Column 4 | Measure | [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
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
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
I guess it switches to an aggregation (only wrapped).
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