Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

How do I do <> in set analysis?

I am trying to load everything in a set analysis statement except one specific and I can't use <>. How do I do it?

7 Replies
MVP
MVP

Re: How do I do <> in set analysis?

Hi,

Use the "-=" operator (it will show as expression error, but it's a bug):

Sum({< Employee -= {'Fred'} >} Sales)

Hope that helps.

Miguel

Not applicable

Re: How do I do <> in set analysis?

Thanks Miguel, much appreciated.

oxtontom
New Contributor III

Re: How do I do <> in set analysis?

Hey mrpjspencer,

I know Miguel has already answered the question with the corrent answer but I often get frustrated that it the "-=" operator will show as a bug so I tend to use this.

=

Sum(

    {

        <

            Employee= {'*'} - {''Fred''}

        >

    } Sales)

It's a longer way to do it but it means you won't see expression errors.

Thanks

Tom

Not applicable

Re: How do I do <> in set analysis?

Thanks, not to fussed about the cosmetics of it as long as it works. Have Qlikview been told about this bug?

Paul.

MVP
MVP

Re: How do I do <> in set analysis?

Hi Paul,

Yes, we know about it. It happened in previous versions and for some reason it keeps happening but the expression works just fine irrespective what the syntax check underlines in red. Hopefully it will be fixed in the coming release.

Regards,

Miguel

Not applicable

Re: How do I do <> in set analysis?

Ive just realised ive got a problem.

 

 

avg

({<Region={[SW],[SE],[KE]},Commercial_Domestic={[Domestic]},Water_Supplier_Text_SW-={[Southern Water]},Waste_Water_Receiver_Text_SW={[Southern Water]

}>}Amount)

See where the writing is Black, its not taking those parts as part of the calculation in my set analysis and is throwing my figures off

Can anyone help?

MVP
MVP

Re: How do I do <> in set analysis?

Hi,

Assuming that in your expression above "SW", "SE", "Domestic" and so are literal values of fields, the syntax should be:

Avg({< Region = {'SW', 'SE', 'KE'}, Commercial_Domestic = {'Domestic'}, Water_Supplier_Text_SW -= {'Southern Water'}, Waste_Water_Receiver_Text_SW = {'Southern Water'

} >} Amount)

More on how to use quotes properly in set analysis can be found in this post, among some others...

Hope that helps.

Miguel

Community Browser