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: 
datagrrl
Creator III
Creator III

Help needed with Correl Syntax/Set Analysis with Variable

=Correl(Aggr(Sum({<Color = {'Orange'},[YFlag] = {1}>} Value),MeasureDate),Aggr(Sum({<Color = {'Blue'},[YFlag] = {1}>} Value),MeasureDate))

So the above expression works perfectly

I now want to open it up for my users to pick "Colors" to compare

I know the Variables are throwing the correct values, because every other object that depends on them is working.

The expression checker says syntax for the following is ok:

=Correl(Aggr(Sum({<Color = {$(vColor2)},[YFlag] = {1}>} Value),MeasureDate),Aggr(Sum({<Color = {$(vColor1)},[YFlag] = {1}>} Value),MeasureDate))

But I get a Null Value.

I am thinking I might have to change this back to a Sum if, but having to include two dimensions it made more sense to use set analysis.

Let me know if you have any suggestions.

Thanks again.

1 Solution

Accepted Solutions
datagrrl
Creator III
Creator III
Author

So I figured this out.

=Correl(Aggr(Sum({<Color = {"$(vColor2)"},[YFlag] = {1}>} Value),MeasureDate),Aggr(Sum({<Color = {"$(vColor1)"},[YFlag] = {1}>} Value),MeasureDate))

I really did try putting quotes in earlier, but they didn't work. I think I may have been putting them on the wrong side of the $.

View solution in original post

1 Reply
datagrrl
Creator III
Creator III
Author

So I figured this out.

=Correl(Aggr(Sum({<Color = {"$(vColor2)"},[YFlag] = {1}>} Value),MeasureDate),Aggr(Sum({<Color = {"$(vColor1)"},[YFlag] = {1}>} Value),MeasureDate))

I really did try putting quotes in earlier, but they didn't work. I think I may have been putting them on the wrong side of the $.