Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik Community,
I've encountered a very peculiar behavior with an expression in Qlik Sense SaaS that seems to defy standard parsing rules and might indicate a bug. I'm hoping to get some insight, confirmation, or a potential explanation for this.
The Goal:
I'm trying to calculate the sum of Revenue for a specific Period defined by a variable vMaxPeriod, using the TOTAL qualifier to get a grand total (disregarding chart dimensions).
The Working Expression (Surprisingly):
My expression only works when structured exactly like this, including the // (comment) characters and specific line breaks:
Sum({$<Period={$(vMaxPeriod)}>} // TOTAL [GL_Hub] Revenue)
Key Observations for the Working Expression:
The Problem: Expressions That Don't Work (and why they should according to documentation):
If I remove the // comment, or if I consolidate TOTAL [GL_Hub] Revenue onto a single line after the set analysis, the expression breaks and returns an error.
Removing // (should work if // were just a comment):
Sum({$<Period={$(vMaxPeriod)}>} TOTAL [GL_Hub] Revenue)
Consolidating TOTAL and Field on one line (standard recommended syntax):
Sum({$<Period={$(vMaxPeriod)}>} TOTAL [GL_Hub] Revenue)
My Environment:
My Question to the Community:
I've verified that $(vMaxPeriod) resolves correctly to a valid period value and that [GL_Hub] Revenue is the correct field reference. The issue consistently lies with the presence/absence of // and the specific line breaks.
Any insights or similar experiences would be greatly appreciated!
Thank you,
Will