Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

set analysis 'not equal to ' syntax

Hi All,

I want to achieve the foll: with set analysis

count of id where field a<> field b

i tried  '<>' and '-='.

But, both did not work.

Please help me out.

Thanks,

Anju

1 Solution

Accepted Solutions
cn_sa_dev
New Contributor III

Re: set analysis 'not equal to ' syntax

i.e.

=

(count({<MPCS_WLDTI={'1','0'}, SDP_WLDTI={'1','0'},MER_MATCH_MASK={'3'},RUN_DATE = {'$(vMaxDate)'}>

        - <MPCS_WLDTI={'1'}, SDP_WLDTI={'1'},MER_MATCH_MASK={'3'},RUN_DATE = {'$(vMaxDate)'}>

        - <MPCS_WLDTI={'0'}, SDP_WLDTI={'0'},MER_MATCH_MASK={'3'},RUN_DATE = {'$(vMaxDate)'}>} distinct MTR_ID)

)

22 Replies
Employee
Employee

Re: set analysis 'not equal to ' syntax

Hello Anju,

Can you please provide a full example of the set analysis statement which you are using? What exactly is it you are trying to achieve with this Set Analysis statement?

Not applicable

Re: set analysis 'not equal to ' syntax

=COUNT({1<A<>B>}ID)

something like this.. but the syntax is wrong...

Not applicable

Re: set analysis 'not equal to ' syntax

I would rather do

count({$ or 1 <A = {"A<>B"} >} ID)

Fabrice

kaushalview
Contributor II

Re: set analysis 'not equal to ' syntax

Hi,

Use syntax -= in set analysis and without set analysis expression <>

Example:

Count({<Country-={'U.S'}>})

  Regards

Kaushal Mehta

Employee
Employee

Re: set analysis 'not equal to ' syntax

Maybe this can solve your need

=COUNT({<A=A-P(B)>}ID)

israrkhan
Valued Contributor II

Re: set analysis 'not equal to ' syntax

try

if(A<>B, Count(ID))

and make sure , The Field Name are In same Caps, if You have field in Database like small a, and you use Capital A in set analysis,i will not work, qlikview is case sensitive...

cn_sa_dev
New Contributor III

Re: set analysis 'not equal to ' syntax

Hi Anju,

"-=" Does work for "not equal to" despite showing a syntax error.  It will underline the statement in red, but the top of the Edit Expression bar will still read "Expression Ok" and it will return the correct data.

Regards,

Chris

Not applicable

Re: set analysis 'not equal to ' syntax

Hi Chris,

I tried this

=COUNT({1<MER_MATCH_MASK={'3'},RUN_DATE = {'$(vMaxDate)'},MPCS_WLDTI-=SDP_WLDTI>}MTR_ID)

it shows a red line under mtr_id , but returns the wrong answer..

it returns the answer satisfying only conditions for mer_match_mask & run_date and

ignores mpcs_wldti

Not applicable

Re: set analysis 'not equal to ' syntax

Hi,

I tried this.But it did not work.

=COUNT({<MPCS_WLDTI=MPCS_WLDTI-P(SDP_WLDTI)}>}MTR_ID)