Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bagdwan1
Partner - Contributor
Partner - Contributor

Set analysis and greater than

Hello,

I have the following data:

LOAD * Inline [

  Dim, Exp

  A, 10

  A, 20

];

I have the following expression:

Count(

       {$<

            Exp = {">=$(vTmp)"}

       >}

DISTINCT Dim)

I select A in Dim and 10 in Exp.

I then have a variable that I set to 15.

I get the result 1.

I wonder why, I would expect 0 since my set analysis uses $ it should take into account the selections that have been made and then the value 20 does not exist.

Does anyone know why I get 1 when the value in vTmp is lower than or equal to the highest value in Exp (20 in this example) regardless of any selections I make?

br

Martin

1 Solution

Accepted Solutions
sunny_talwar

Basically your set analysis over-ride any selections you make for the fields that are explicitly added to the modifier

Count(

      {$<

            Exp = {">=$(vTmp)"}

      >}

DISTINCT Dim)

So, for all fields except Exp, the expression is going to filter. But you can write your expression like this and then the expression will give you the intersection of your selection and set modifier

Count(

       {$<

            Exp *= {">=$(vTmp)"}

       >}

DISTINCT Dim)

Read about the asterisk here Implicit Set Operators

View solution in original post

1 Reply
sunny_talwar

Basically your set analysis over-ride any selections you make for the fields that are explicitly added to the modifier

Count(

      {$<

            Exp = {">=$(vTmp)"}

      >}

DISTINCT Dim)

So, for all fields except Exp, the expression is going to filter. But you can write your expression like this and then the expression will give you the intersection of your selection and set modifier

Count(

       {$<

            Exp *= {">=$(vTmp)"}

       >}

DISTINCT Dim)

Read about the asterisk here Implicit Set Operators