# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Contributor

Hi.

I'm read a lot about set analysis, but i have a doubt yet...For example, in a pivot table witch i have two dimension

1º Product

2º Shop Set

And one of the is the max Cost, so..

Store 1,2,3 | Store 4,5,6 | Store 7,8,9

Produc1        1,2                4,2                3,7

Produc2        3,6                2,9                1,5

Produc3        2,8                1,4                1,2

What i want is a set analysis who bring me always the cost of sotre 5, so the table would be:

Store 1,2,3 | Store 4,5,6 | Store 7,8,9

Produc1        4,2                4,2                4,2

Produc2        2,9                2,9                2,9

Produc3        1,4                1,4                1,4

But when i do

max({<store={'5'}>} cost)

It return

Store 1,2,3 | Store 4,5,6 | Store 7,8,9

Produc1          -                 4,2                -

Produc2          -                 2,9                -

Produc3          -                 1,4                -

Someone know if i can do this?

1 Solution

Accepted Solutions
Valued Contributor III

## Re: Doubt about Set Analysis

try

max(total <Product> {<store={'5'}>} cost)

4 Replies
Honored Contributor III

## Re: Doubt about Set Analysis

Can you share actual representation of your pivot table, not sure how Store 4,5,6 is actually appearing as data. is it denoting three different stores in a field or something else?

Valued Contributor III

## Re: Doubt about Set Analysis

try

max(total <Product> {<store={'5'}>} cost)

Contributor

## Re: Doubt about Set Analysis

Yes, but i did a group os store by city...So Stores 4,5,6 they're part the same city,

in script a have:

If(substringcount('4|5|6',store)>0, 'City One')

So, the max return the maximum cost Of these stores...

Contributor

## Re: Doubt about Set Analysis

Thanks...It worked out