Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Contributor III
Partner - Contributor III

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)

)

View solution in original post

22 Replies
mjm
Employee
Employee

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
Author

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

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

Not applicable
Author

I would rather do

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

Fabrice

kaushalview
Partner - Creator II
Partner - Creator II

Hi,

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

Example:

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

  Regards

Kaushal Mehta

Clever_Anjos
Employee
Employee

Maybe this can solve your need

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

israrkhan
Specialist II
Specialist II

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
Partner - Contributor III
Partner - Contributor III

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
Author

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
Author

Hi,

I tried this.But it did not work.

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