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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
raynac
Partner - Creator II
Partner - Creator II

Set Analysis Syntax

Hi everyone... I am hoping someone can assist.  We have had a view here for a literal decade or more that contains many set analyses, and while I am 99.9% positive that they were fine before, suddenly we are getting an error message from them.  They still appear to work fine and produce a correct number; that's the strange part.  But I need to use the numbers in other calculations and the same set analysis code seems to not be working in the new formulae.

Here is the formula.  The red underline begins after the first $ and goes the length of the formula, with the error in the header reading, rather unhelpfully, "Errors in expression".  I have broken out the pieces and ascertained that it looks to be correct syntax.  Can anyone see what's wrong here?  Thanks so much for any guidance you can provide!

=sum({[Group 3]<[Property Description]=$::[Property Description],
[Building Description]=$::[Building Description],
[Group/Transient]=$::[Group/Transient],
[Group Block]=$::[Group Block],
[Guest Type Description]=$::[Guest Type Description],
[Guest Type Group Description]=$::[Guest Type Group Description],
[House Use]=$::[House Use],
[Owner/TimeShare]=$::[Owner/TimeShare],
capture_date={'$(v_forecast_capture)'},
[Stats Date]={'>=$(v_forecast_start_pace)<=$(v_forecast_end_pace)'}>}$(vroomnights))

Labels (1)
12 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I tested it in my QlikView Desktop (Ver. May 2024), and I can see that the expression editor doesn't like it when Alternate State is enclosed in square brackets. For this reason, I'd recommend avoiding spaces in Alternate State names.

Having said that, the expression worked as expected, despite the red lines. It happens quite frequently that expression syntax is highlighted as wrong, while the expression works just fine. This appears to be one of these cases. 


raynac
Partner - Creator II
Partner - Creator II
Author

Hi @Oleg_Troyansky - nailed it!  That's exactly what it was.  I almost never put spaces in anything (I even rarely use underscores as I was taught to use "camel case" when I was in school) but my colleague who did this likely didn't realize it would cause trouble later!  I am going through and recreating "Group 1" as "Group1" etc just to clean up the code, and because I really do think it's causing trouble in larger calculations.  Thank you so much for persevering to help me... I deeply appreciate you and your help!