Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
bertrand_herard
Partner - Contributor III
Partner - Contributor III

Getting current value of valueList or valueLoop

Hi,

When using a synthetic Dimension in a chart with functions like ValueList() ou ValueLoop(). Is there any way to display the current dimension value in Expressions ?

(I’m using Rowno() function but I would like to get the Dimension Value).

Regards

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Set analysis gets evaluated once for an objcet(NOT row-wise), try with 'if' like:

=If(ValueLoop(2010,2014)<=2013,

sum(If(Year=ValueLoop(2010,2014),Value)),

sum(If(Year=ValueLoop(2010,2014)-1,Value))

)

View solution in original post

12 Replies
tresB
Champion III
Champion III

Use the same valuelis()/valueloop() expression in the expression tab. Like:

Dimension: ValueList(1,2)

Expression: ValueList(1,2)

bertrand_herard
Partner - Contributor III
Partner - Contributor III
Author

As far as I know, ValueList and ValueLoop functions do not work in Expressions in graph, are they ?

If I'm wrong, can you please send me a little example ?

Regards

tresB
Champion III
Champion III

Yes, they do. It would be better, if you could explain your requirement in more details with a sample qvw.

bertrand_herard
Partner - Contributor III
Partner - Contributor III
Author

Here is what I'm trying to do : in a grah

I've a calculated dimension in a graph with value = ValueList(2010,2014).

In Expressions i'd like to have a difference behaviour depending of the current value of valuelist (exemple :

If ValueList current value <=2012, the expression returns the same value as the valuelist, if ValueList>2012 the expressions returns Valuelist value -1.

tresB
Champion III
Champion III

Try this in expression:

=If(ValueList(2010,2014)<=2012, ValueList(2010,2014), -1)

MarcoWedel
MVP
MVP

=If(ValueList(2010,2014)<=2012, ValueList(2010,2014), ValueList(2010,2014)-1)

MarcoWedel
MVP
MVP

or

=ValueList(2010,2014)+(ValueList(2010,2014)>2012)

tresB
Champion III
Champion III

Did he mean that?. Hope he understood how it works and modified according to his requirement.

bertrand_herard
Partner - Contributor III
Partner - Contributor III
Author

Thanks your answers helped me,

I've manage to build my expression =If(ValueLoop(2010,2014)<=2012, ValueLoop(2010,2014), -1).

Unfortunately my final goal was to put this expression in a Set Analysis like this :

sum({<Year={

If(ValueLoop(2010,2014)<=2012, ValueLoop(2010,2014), -1)

}> MyIndic)

I've an issue :  if I use the expression in $()  it evaluate only one value of it for the whole table /graph

Any idea about this ?

Regards