Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
drohm002
Creator
Creator

set analysis variable construction

Please see my data table below.  I want to create a variable that counts the number of 'ID's with days less than 90.  When I create the variable on my own, it gives me 6 as the answer, but really the answer should be 2 ID's.  I know I need to use the distinct function, but I just cant get the formula to work.  How can I accomplish this?  Thank you!

   

IDdays
15
15
15
220
220
220
3100
3100
3100
1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

May be this?

= Count({<days = {"<90"} >}ID)

OR

= Count(DISTINCT {<days = {"<90"} >}ID)

View solution in original post

21 Replies
vishsaggi
Champion III
Champion III

May be this?

= Count({<days = {"<90"} >}ID)

OR

= Count(DISTINCT {<days = {"<90"} >}ID)

sunny_talwar

May be this

Count(DISTINCT {<ID = {"=Sum(days) < 90"}>} ID)

eduardo_dimperio
Specialist II
Specialist II

Maybe this

Count({<days={"=$(<=90)"}>}ID) in set analysis.

If you need in script i think is easier

eru-alelo
Contributor
Contributor

Hello, would it be possible to add more than one variable in this formula?

Because I have a base that needs to do the same type of scenario, but with more variables

vishsaggi
Champion III
Champion III

Can you give an example of what you are expecting?

eru-alelo
Contributor
Contributor

= IF(and (Sum (month1, month2, month3) = 0; "Churn90"; if ((sum (month 1, month2) = 0; "Churn60"; "No Billing"

How could this variable be made?

eru-alelo
Contributor
Contributor

Exemple .xls..PNG

vishsaggi
Champion III
Champion III

Try this?

= IF( RangeSum(month1, month2, month3) = 0, "Churn90",

  if( Rangesum(month1, month2) = 0, "Churn60", "No Billing"))

eru-alelo
Contributor
Contributor

It did not work, because I'm trying to apply this variable to the script.

Where I need the form to add (Jan; Feb; Mar; Abr) = 0; Scene 1; and so on.Exemple .xls..PNG