
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using range functions instead of num sum/num count
Hi! We are currently optimizing Qlik Performance and I read one best practice where I need to use range functions instead of the usual num(sum), num (count) function. I found limited examples online for range functions on the front end.
If I have the ff. as my expression:
(num(count(distinct {<[FIELD1] = {'Yes'}>}[ID FIELD]),vFormatCount0) / num(count(distinct {<[FIELD2] = {'wrapup'}>}[FIELD ID]),vFormatCount0)) * 100
How do I change the expression to one using Range function?
Also, does this help with the overall UI Calculation/Qlik Optimisation?
Thank you!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Numsum() and Num(Sum(.... are NOT same. Similarly for count().
Numsum() is one function and Num(Sum(.. is combination of two functions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please see below screenshot.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Numsum() and Num(Sum(.... are NOT same. Similarly for count().
Numsum() is one function and Num(Sum(.. is combination of two functions.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree with Tresesco that the range-functions couldn't replace the aggregations like sum() or count() because they work in a different direction - sum/count will aggregate the items (fieldvalues within a column) vertically and the range-functions do the calculation horizontally like: rangesum(Field1, Field2, ...).
Beside this you could optimize your expression if leave the num() because the result of num() / num() will be again unformatted. Further you could replace your string conditions within the set analysis with a numeric value - this means something like 'Yes' or 'No' with 1 or 0.
But usually you won't notice a significantly performance improvement through these kind of measures - by really large datasets and many objects on the sheet it might be different.
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
