Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sr_qlikview
Creator
Creator

valuelist and valueloop functions

Can someone explain me these valuelist and valueloop functions with examples. I tried reading the reference manual but not able to understand exactly. Also what is synthetic dimension means.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

For example, create a calculated dimension in a straight table:

=ValueList('KPI1','KPI2')

Then, an expression like

=pick(match(

               ValueList('KPI1','KPI2')

          ,'KPI1','KPI2')

,sum(FIELD)

,count(FIELD)

)

You'll get a dimension with two value, KPI1 and KPI2. To check in your expression, which is the current dimension value, you'll need to repeat the Valuelist() function as used in the dimension again in the expression. (Above can also be written as

=if( ValueList('KPI1','KPI2') = 'KPI1', sum(FIELD),

if( ValueList('KPI1','KPI2') = 'KPI2', count(FIELD) ))

So you can create a dimension on the fly in a chart which is not based on a field in your data model (I think that's why its called synthetic).

Valuelist() just uses the values you are listing as arguments, valueloop creates the dimension values based on start, end and step values.

Hope this helps,

Stefan

View solution in original post

4 Replies
swuehl
MVP
MVP

For example, create a calculated dimension in a straight table:

=ValueList('KPI1','KPI2')

Then, an expression like

=pick(match(

               ValueList('KPI1','KPI2')

          ,'KPI1','KPI2')

,sum(FIELD)

,count(FIELD)

)

You'll get a dimension with two value, KPI1 and KPI2. To check in your expression, which is the current dimension value, you'll need to repeat the Valuelist() function as used in the dimension again in the expression. (Above can also be written as

=if( ValueList('KPI1','KPI2') = 'KPI1', sum(FIELD),

if( ValueList('KPI1','KPI2') = 'KPI2', count(FIELD) ))

So you can create a dimension on the fly in a chart which is not based on a field in your data model (I think that's why its called synthetic).

Valuelist() just uses the values you are listing as arguments, valueloop creates the dimension values based on start, end and step values.

Hope this helps,

Stefan

IAMDV
Luminary Alumni
Luminary Alumni

I'm sure Stefan covered everything you need. Here is an example of practical implementation of using ValueLoop() function...

http://community.qlik.com/message/222888#222888

Happy Learning!

Cheers,

DV

www.QlikShare.com

sr_qlikview
Creator
Creator
Author

Hello Deepak...i have gone through your videos for pick, match functions along with the discussion post you mentioned, its very helpful... thank you.

IAMDV
Luminary Alumni
Luminary Alumni

You're welcome. I'm glad it was useful. I'll make a video on ValueLoop() very soon.

Happy learning!

Cheers,

DV

www.QlikShare.com