Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can't seem to get set analysis to work

Hi Community,  I'm trying to get the set anaylis to the count of request id's where 3 fields have selections.  I want the [Tech Name] field to be NA, I want the [Request Data Type] to be created, and I want the [Status] field to be anyhing but "Waiting for Approval" or "Closed".  I've tried it a couple differenet ways but none give me the correct value for some reason.

Way A:

count(

      {1<[Request ID]=P({1<[Tech Name] = {"NA"}>})*P({1<[Request Data Type] = {"Created"}>})*E({1<[Status] = {"Waiting for Approval","Closed"}>})

          >}

          [Request ID]

)

Way B:

count(

          {1<[Tech Name] = {'NA'},

          [Request Data Type] = {'Created'}

          [Status] = {'Waiting for Approval'}

          >}

          [Request ID]

)

Way C:

count(

  {1<[Status] =- {'Closed'}>*<[Request Date Type]={'Created'}>*<[Tech Name] = {'NA'}>}

          [Request ID]

)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Brandon,

I think the original suggested expression should work (assuming that we are looking at the unassigned requests gauge chart and the tickets created vs pending table.

Both are showing 16 now. Am I missing something?

I you select in the list boxes for comparision, you need to take care that you start with a cleared selection, thus preventing that some field values are not possible to select because of other selection (i.e. excluded), then you select all possible values and clear the other field (or change to another selection in that field), and you won't see that you missed a possible value for the linked field.

I noted in your posted sample, that you used a set modifier for the Request Data Type field twice. I wouldn't do that, I believe only one definition will be used (you can't add field set modifiers like that, if that was your intention).

Regards,

Stefan

View solution in original post

11 Replies
swuehl
MVP
MVP

Try way 😧

Way B:

count(

          {1

          <[Tech Name] = {'NA'},

          [Request Data Type] = {'Created'},                          // added comma to the end

          [Status] -= {'Waiting for Approval', 'Closed'}          // using minus equal (AKA exclude) and added  value to element list

          >}

          [Request ID]

)

Not applicable
Author

Sorry I was playing around with the set analysis before I pasted it (thats why there's no comma), but I still have the same issue.  Basically, I need to get a better understanding of set analysis. 

What I want to be able to do is hard code some gauges with values that don't change based on selections. The code below sort of does this but it gives me a value thats double what it should be.  This is because it doesn't just count 

[Request Data Type] even if I add a line like [Request Data Type] =- {'Completed'},  If I comment out the line on [Request Data Type], I still get the same value too.  In a nut shell, is there a sure fire ways to hard code the selections?  Basically I want all values with only the 3 selections that I've described above.  I've tried things line <>*<>*<> the intersection for 3 selections but it hasn't worked yet.

{1

          <[Tech Name] = {'NA'},

          [Request Data Type] = {'Created'},                       

          [Status] -= {'Waiting for Approval', 'Closed'}         

          >}

          [Request ID]

swuehl
MVP
MVP

Brandon,

if you select NA in field Tech Name, Created in field Request Data Type and All Status except Waiting for Approval an Closed, do you get the correct result using count([Request ID]) ?

I am not sure why you are trying do work with intersection, could you elaborate on this?

Not applicable
Author

Yes I get the correct result of 26 with just count([Request ID]) while I get 52 with hard coded

{1

          <[Tech Name] = {'NA'},

          [Request Data Type] = {'Created'},                      

          [Status] -= {'Waiting for Approval', 'Closed'}        

          >}

          [Request ID]

swuehl
MVP
MVP

Do you have some records for Status with NULLs?

Not applicable
Author

Its a list box and it doesnt have an empty place in the field vlaues and doesn't look like there is any exclude null values selected.

Not applicable
Author

plus it's double the value it should be and seems like its just not filtering out the Request Data Types that are completed.

swuehl
MVP
MVP

Well, you are using set identifier 1 in your set expression. This will exclude any other selection. I assume you don't have any other selections when comparing to your results and selections in list boxes (maybe double check with a current selection box, that there are no hidden selections).

Could you post a small sample app here?

Not applicable
Author

Attached is the document in full.  I'm only looking at the main page which is thetab you open to.