# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

## Set Analysis... Help with this Multiple Condition please!

I'va a table with these dimensions:

1)Cliente

2)Descrizione Articolo

I've created two different expressions that calculate sales (vfatturatoAc)  and quantity (qfatturatoAC) for each client (cliente) and for specific category of product (N°Conto):

Sales: =Only({<[N° Conto]={"0501001*"}>}VFatturatoAC)

Quantity: =Only({<[N° Conto]={"0501001*"}>}QFatturatoAC)

My question is how can i calculate how many spare parts ([N° Conto]={"0501001*",0501002*"}) has bought those client who bought at least One of this product ([N° Conto]={"0501001*"}).

Hope to be enough clear.

Thanx.

Francesco.

10 Replies
MVP

## Re: Set Analysis... Help with this Multiple Condition please!

Not sure I completely understand, do you have a sample to look at?

## Re: Set Analysis... Help with this Multiple Condition please!

I don't know how you calculate the number of spare parts, but you need a set definition that looks something like:

{<[N° Conto]={"0501001*",0501002*"}, Cliente=p({<[N° Conto]={"0501001*"}>}Cliente) >}

That means filter [N° Conto] to those two values and also select only the possible clients that are left when [N° Conto] is filtered on 0501001*.

talk is cheap, supply exceeds demand
Not applicable

## Re: Set Analysis... Help with this Multiple Condition please!

Thanx for the answer!

Now, after your advice my expression is:

=Sum({<[N° Conto]={"0502001*","0502002*"}, Cliente=p({<[N° Conto]={"0501001*"}>}Cliente) >}VFatturatoAC)

where:

Spare Parts:[N° Conto]={"0502001*","0502002*"}

Client that bought a specific product: Cliente=p({<[N° Conto]={"0501001*"}>}Cliente

Sales: VfatturatoAc

It seems to work! But....

Now I also have to tell him to exclude customers who bought another specific product [N° Conto]={"0501006*"}. How is possible?

Thanx

MVP

## Re: Set Analysis... Help with this Multiple Condition please!

May be like (not tried though):

=Sum({<[N° Conto]={"0502001*","0502002*"}, Cliente=p({<[N° Conto]={"0501001*"} - p({<[N° Conto]={"0501006*"}>}Cliente) >}VFatturatoAC)

Not applicable

## Re: Set Analysis... Help with this Multiple Condition please!

it gives me an error in the first bracket:

Error in set modifier expression:

Sum(       {<[N° Conto]={"0502001*","0502002*"}, Cliente=p({<[N° Conto]={"0501001*"} - p({<[N° Conto]={"0501006*"}>}Cliente) >}VFatturatoAC)

MVP

## Re: Set Analysis... Help with this Multiple Condition please!

Sorry, try :

=Sum({<[N° Conto]={"0502001*","0502002*"}, Cliente=p({<[N° Conto]={"0501001*"}>}) - p({<[N° Conto]={"0501006*"}>}Cliente) >}VFatturatoAC)

## Re: Set Analysis... Help with this Multiple Condition please!

Hi,

might  be i am wrong but i did not get your expression when you say

[N° Conto]={"0501001*"} then it include only that value which start with 0501001 and it will not consider

value which start with 0501006 then why this [N° Conto]={"0501006*"} to exclude it from [N° Conto]={"0501001*"}

???

Regards

Regards,
Prashant Sangle
Not applicable

## Re: Set Analysis... Help with this Multiple Condition please!

I've tried your expression but the results doesn't include only Cliente who bought {"0501001*"}.

Where's the problem??

MVP

## Re: Set Analysis... Help with this Multiple Condition please!

Could you post a sample qvw with explained expected output?