Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jason_nicholas
Creator II
Creator II

Nested Variables in Set Analysis

I have an expression which uses a variable in the set analysis. That variable is meant to return a text value of a set analysis function, based on a series of nested variables. This function is working, but the expression editor is indicating an error. Could someone help me identify a way to eliminate the error while retaining the functionality?

The expression is:

IF(Year<=varCurrentYear,COUNT(DISTINCT{$<$(varAVSelectorBookings)>    }[Booking ID]))

With the error being the underlined/italicised section after the space at the end   "  }[Booking ID]))   "

I have buttons that select 0,1,2, or 3 for a variable varAVSelector

varAVSelectorBookings has a value of

=IF(varAVSelector=1,varEvent,(IF(varAVSelector=2,varMSR,(IF(varAVSelector=3,varSR,(IF(varAVSelector=0,'X')))))))

So, if I hit the button that sets varAVSelector to1, I return varEvent

varEvent has a value of [Event Flag]={'Event'}

varMSR and varSR also have similar set analysis formatted values, using a field other than [Event Flag]

Based on which button I hit, I trigger a 0-4 value for varAVSelector, which causes the variable varAVSelectorBookings to return a value as text which takes the place of the variable in the set analysis.

As I said, this function is working correctly. It is a complicated way to combine data that is related in practice, but not in method of extraction. It allows my end users to think and review data as they understand it, without the need to deal with complexities of the function. I am just concerned about the Function Error message in the expression editor, and how that may impact data in unforseen ways. I'd appreciate any help you could provide.

1 Reply
sunny_talwar

Unfortunately, you won't be able to avoid the error message if you use the variable. The error message just mean that QlikView expression editor doesn't understand the un-expanded variable in set analysis.