Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Not applicable

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])

View solution in original post

14 Replies
Highlighted
Not applicable

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

Highlighted

may be like this

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

Regards

ASHFAQ

Highlighted
Not applicable

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


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


any other suggestion?

Highlighted
Not applicable

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

Highlighted

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

Highlighted
Not applicable

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

Highlighted
Not applicable

Try this


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


Thanks & Regards

Milind

Highlighted
Not applicable

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?

Highlighted
Not applicable

this is the original file...

and yes, the name was correct in the formula