Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

2 fields not equal to 0 in set analysis

How do i write the following statement in set analysis?

[College]<>0 or [University]<>0

[College]<>0

is

[College]-={0}

in set analysis. But how about 2 fields using the OR statement to be equal to 0. I am new here and appreciate the help. Thanks.

15 Replies
Not applicable
Author

try this:

{<College-={'0'}> + <University-={'0'}>}

Not applicable
Author

Hi,

Try this one

count({$<College-={"=len(trim(College))=0"}>+<University-={"=len(trim(University))=0"}>} id_user)

ankitaag
Partner - Creator III
Partner - Creator III

This will work

Script:

LOAD * INLINE [

    Name, College, University, Value

    A, a, b, 100

    B, a, 0, 220

    C, 0, b, 443

    D, a, b, 342

    E,0,0,4545

];

sum({<College-={0},University-={0}>}Value)

Result is

Name   Value

A               100

D               342

If you want to use an operator then the below expression will give you the same result as above :

sum({<College-={0}>*<University-={0}>}Value)

Anonymous
Not applicable
Author

Here is how I solved it. Instead of using the OR operator between the fields, I put the individual fields in the  formula, replicated it and put OR in between the formulas.

Here is an example:

<formula

,[College]-={0}

formula>

+

<formula

,[University]-={0}

formula>

The Qlikview syntax checking mechanism is only accurate until a certain extent. In complex formulas like the one I was implementing, it showed error but worked. I appreciate all your guys suggestions and hope this would help others who would encounter a similar issue as me.

Not applicable
Author

I think you can try with this

{<college={'*'} - {'0'}> + <university={'*'} - {'0'}>}

ankitaag
Partner - Creator III
Partner - Creator III

not working for me