Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

ValueList to match with multiple values

Hi,

I have a situation where I need to write a valuelist expression something like this

Dimension:

ValueList('S', 'P')

Expression:

If ( valuelist('S', 'P') = ('SA', 'ST'), SUM(AMT), if (valuelist('S', 'P') = ('PA', 'PT'), SUM (QNT)) )

so I need to match the 'S' with two values ('SA', 'ST') and 'P' with ('PA', 'PT').

is it possible?

thanks

Jean

Labels (1)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Looking into your sample data and requirement, it seems that you could use a calculated dimension instead. 

Calc Dim : Left(Entity, 1)

Exp : Sum(QNT)

You have to find a pattern for calculated dimension if this doesn't exactly solve your case issue.

View solution in original post

5 Replies
Highlighted
MVP & Luminary
MVP & Luminary

If it's already your real-case the following simplifying should be enough:

If(valuelist('S', 'P') = 'S', SUM(AMT),  SUM (QNT))

- Marcus

Highlighted

What is SA and ST here? Valuelist is only S or P... is there another dimension in this chart?

Highlighted
Creator
Creator

What I want to achieve here is grouping of certain entities.

The real entities are SA, ST, PA and PT.

What I need to do is to have a synthetic dimension which groups SA,  ST in S and PA, PT in P.

I do not know if there is anything in Qlik which can do that. 

The closest function which I could think of was ValueList so I used it to express my need.

I hope it is clear now.

Highlighted
MVP & Luminary
MVP & Luminary

The use of valuelist() is often the most unsuitable way of creating a (part of a) datamodel. The recommended way is to associate all dimensions directly within the script/datamodel. Should this really not possible you could create such synthetic dimensions also within the datamodel as loosen tables (tables which have no further connection to other tables) for example with simple inline-statements because it's more flexible and easier to handle within the UI as with a valuelist().

- Marcus

Highlighted
MVP
MVP

Looking into your sample data and requirement, it seems that you could use a calculated dimension instead. 

Calc Dim : Left(Entity, 1)

Exp : Sum(QNT)

You have to find a pattern for calculated dimension if this doesn't exactly solve your case issue.

View solution in original post