Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

coreyhulse
New Contributor

Variable Length Limit?

Hi Everyone,

Is there a limit to the Length of a given variable in QlikView 8.5?

Long story short, I'm using QlikView 8.5 for a client to create a simluated P&L statement.

I'm using a Pick-Match setup, and populating the MATCH part with 40+ different choices.  To make the code reusable, instead of this:

PICK(MATCH([Metric ID], 1, 2, 3...39, 40), SUM(1), MAX(2), AVG(3)...SUM(39), SUM(40))

I'm doing this:

PICK(MATCH([Metric ID], $(MetricIDList)), $(MetricSyntaxList))

The problem is, my $(MetricSyntaxList) variable is now 5,200+ characters, and no longer works.  I know my syntax is correct, because it works if it's under 5,200 characters and breaks if it's over 5,200 characters.

Any thoughts?

Thanks in advance.

Tags (3)
7 Replies
MVP
MVP

Variable Length Limit?

I don't think there is supposed to be a limit.  That said, I believe I've run into expression length limits before when specifically trying to test that.  When long enough, I've had valid expressions crash out the entire application.

Unfortunately, I don't know of a good workaround for what you seem to be trying to do. 

Maybe if you need this in a chart type that allows hidden expressions, you could check for a limited number of metrics in several different pick(match()) expressions.  Then create a final expression that picks the first non-null value from the previous results.  That's assuming the limit is related to one expression or variable, and not to the total across several.  Since the limit is likely a bug, it's very hard to guess what might and might not work.

Not applicable

Variable Length Limit?

Hi Corey, I had the same problem in a big customer with big complex expression in version 8.5, unfortunately we could not find a good way the solve it, but to migrate to version 9. I guess you can have a good chance using hidden expressions as John pointed out.

Regards

valera_sh
Contributor II

Variable Length Limit?

Guys,

we are having the same problem with Qlikview 10 SR3.

We have some very long formulas in a dozen of variables. One table incorporates all the calculations, so the table expression has a number of IFs that decide which variable to display.

At a certain point the table stops evaluating the variables.

We consider this a bug since there are no explicit indications by Qliktech about the variable length limit.

Regards,

Valeriy Shylin

valera_sh
Contributor II

Variable Length Limit?

Solution is found - autocommenting expressions!

Not applicable

Re: Variable Length Limit?

What is autocommenting expressions?

I need it because I have many calculations to put in variables with pick match.

I try to do a time and metric dimension that the user can choose.

Thanks !

Patrick

Not applicable

Re: Variable Length Limit?

This is a rather old topic, but I suspect you can autocomment expressions by adding variables.

Example:

First set variable, name it vCommentEnabled and set definition to:

if($1=1,'//','')

Then add a text object to the sheet with expression:

='test 1  ' &  $(=$(vCommentEnabled(0)))  'test2'

And add another text object to the sheet with expression:

='test 1  ' &  $(=$(vCommentEnabled(1)))  'test2'

You'll notice that based on the parameter 1/0 the latter of the expression is automatically commented out. That is, the 'test2' bit of the expression can be dynamically commented, depending on the output of the variable vCommentEnabled acting as a user defined function.

Not applicable

Re: Variable Length Limit?

Hi Jasper,

Thanks for your example, it opened my eyes on the power of variables.

Patrick

Community Browser