Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Contributor 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


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

Re: Nested Variables in Set Analysis

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.