Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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
Not applicable
Author

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

ashfaq_haseeb
Champion III
Champion III

may be like this

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

Regards

ASHFAQ

Not applicable
Author

=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
Author

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

ashfaq_haseeb
Champion III
Champion III

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
Author

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

Not applicable
Author

Try this


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


Thanks & Regards

Milind

Not applicable
Author

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
Author

this is the original file...

and yes, the name was correct in the formula