Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
anselmo_meira
Contributor II

Set analysis with len( variable)

Guys,

I've built a set analysis for a textbox but i'm having troubles in checking a variable lenght.

sum( {<'$(=vVariable)' = {"=len($(=vVariable)) =0"} >} DIMENSION)

Does anyone have an idea?

Thanks in advance.

9 Replies
Employee
Employee

Re: Set analysis with len( variable)

Please add this formula as an expression to a straight table with no label on it

Mouse over the header and check how your expression is beeing evaluated

Re: Set analysis with len( variable)

How you define here vVariable

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
anselmo_meira
Contributor II

Re: Set analysis with len( variable)

Hi Anil,

The vVariable here is a number.

anselmo_meira
Contributor II

Re: Set analysis with len( variable)

Everything seems right in this. but it is not working.

Employee
Employee

Re: Set analysis with len( variable)

Would you mind posting a screenshot of your test?

Employee
Employee

Re: Set analysis with len( variable)

vVariable returns a number?

'$(=vVariable)' = {} it´s supposed to be a fieldname so you can use as a Set Analysis expression


anselmo_meira
Contributor II

Re: Set analysis with len( variable)

Is there a way of putting a number on it?

anselmo_meira
Contributor II

Re: Set analysis with len( variable)

The function sum( {<'$(=vVariable)' = {"=len($(=vVariable)) =0"} >} DIMENSION)

returns  =sum({<'' = {"len()"=0}>} DIMENSION)  when I set the variable's value null.


I think the set analysis cannot retrieve a value because it cannot evaluate a null value in the left part of equation (=sum({<'' = ).


Do you have an idea to overcome that?

Thanks in advance.

Employee
Employee

Re: Set analysis with len( variable)

Let´s start from the beginning...

What´s your intention? Maybe undestanding what you trying to do we can help a little better

A set analysis expression is supposed to have :

Sum({<aField={"Some search expression"}>}Value)

You can have a variable on left side of expression since this variable returns a fieldname