Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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