Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Which approach has better performance

Hello
got the following requirement:
the user has to select one fiscal year 
Current fiscal year is 2026
if the user selects 2026 or above
then the chart has to display Budget Amount
but is the user selects any fiscal year before 2026 then chart should display Actual Amounts
I wrote the below expression:

sum
    (
        {
            <scenario={actual},fiscal_year
*={"<2026"}>
            +
           <scenario={budget},fiscal_year*={">=2026"}>

       }
amount)
but some suggest that I write the following:
sum({<scenario={actual},fiscal_year*={"<2026"}>}amount)
+
sum({<scenario={budget},fiscal_year*={">=2026"}>}amount)

which approach has better performance

I can walk on water when it freezes
Labels (3)
1 Reply
Chanty4u
MVP
MVP

Hi

In general, the second expression is not inherently faster. In fact, it requires Qlik to evaluate two aggregation expressions, whereas the first uses a single aggregation with a combined set.

For pure performance, don't expect a meaningful advantage between the two versions. For your requirement, I'd prioritize the expression that correctly uses the selected FY; If(Only(fiscal_year)... is often much clearer