Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Where Clause in Set Analysis

Hi everyone, is it possible to write something like that in a formula (set analysis)?

=Sum ([QTA 1 Documento]), where [Documento] in 'INT-BUONOCAR','INT-BUONOSCA'

please do not suggest me to use the where clause in Load, because I cannot do it...I need to find a way to use it in the set analysis...

Thanks to anyone, who will try to answer me!

1 Solution

Accepted Solutions
Not applicable

Re: Re: Where Clause in Set Analysis

If Codice Documento is a variable:

if([Codice Documento] = 'INT-BUONOCAR' or [Codice Documento] = 'INT-BUONOSCA', sum(QTA 1 Documento))

If Codice Documento is a field in your data model:

sum({<[Codice Document] = {'INT-BUONOCAR','INT-BUONOSCA'}>} [QTA 1 Documento])

14 Replies
Not applicable

Re: Where Clause in Set Analysis

You can't use where within set analysis. However:

=Sum({<Documento = {'INT-BUONOCAR','INT-BUONOSCA'}>} [QTA 1 Documento])

Should work.

{<Document = {'INT-BUONOCAR','INT-BUONOSCA'}>} this expression tells the sum function to only documents that have the name INT_BUONOCAR and INT-BUONOSCA

Re: Where Clause in Set Analysis

may be like this

Sum ({< [Documento]={'INT-BUONOCAR','INT-BUONOSCA'}>}[QTA 1 Documento])

Regards

ASHFAQ

Not applicable

Re: Where Clause in Set Analysis

=Sum({<[Codice Documento]= {'INT-BUONOCAR','INT-BUONOSCA'}>} [QTA 1 Documento])


it doesn't work...it doesn't select those specific values...


any other suggestion?

Not applicable

Re: Where Clause in Set Analysis

Could you share your qvw? Not sure why it wouldnt work.

Re: Where Clause in Set Analysis

Hi you are using

Sum({<[Codice Documento]= {'INT-BUONOCAR','INT-BUONOSCA'}>} [QTA 1 Documento])


use this intead

=Sum({<Documento = {'INT-BUONOCAR','INT-BUONOSCA'}>} [QTA 1 Documento])


or post a sample app.


Regards

ASHFAQ

Not applicable

Re: Where Clause in Set Analysis

Yes, make sure you are using the exact field names from your qvw or it will not work.

Not applicable

Re: Where Clause in Set Analysis

Try this


=Sum({<[Codice Documento]= {"INT-BUONOCAR","INT-BUONOSCA"}>} [QTA 1 Documento])


Thanks & Regards

Milind

Not applicable

Re: Where Clause in Set Analysis

Could you provide some more info about INT-BUONOCAR and INT-BUONOSCA?

Are these field values in your data model or are they variables you made in your document?

Not applicable

Re: Re: Where Clause in Set Analysis

this is the original file...

and yes, the name was correct in the formula

Community Browser