Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasdavis500
Creator III
Creator III

Ignoring Certain Fields using Variables in Set Analysis

Is it possible to ignore certain fields using set analysis with a variable? I currently have some fields I would like to ignore in my expressions, so that my end user can view %'s based on selections.

Currently I have expression similar to this:

COUNT({<Some Set Analysis>}Pkey)

/

COUNT({<Some Set Analysis>}Pkey)

Untouched, this would be 100%. When the user makes selections, I want the top piece to be affected by selections, but not the bottom. I know I can do something like this for the bottom piece:

COUNT({<Field1=, Field2=, Field3=, >}Pkey)

but I don't want to do it this way, I have many charts and tables that I want to ignore selections in, and it will not be easy to make changes if the user wants a field added or taken off of their dashboard. How can I store this into a variable so that the variable expands to all of the fields?

I tried this:

vIgnore = Field1=, Field2=, Field3=, ........

so the expression became:

COUNT({< $(vIgnore) >}Pkey)

but qlikview doesn't seem to like this. Is there a way ignore specific fields easily? a way that I won't have to update 75 expressions everytime I need to make a change

13 Replies
swuehl
MVP
MVP

I think $(vIgnore) should work if the variable is set up correctly. How did you do it?

Or maybe have a look at:

Ignore all selections except some specific fields using Set Analysis

lucasdavis500
Creator III
Creator III
Author

vIgnore in the Variable Overview window is as follows:

Company=, [Product]=, [Classification]=, [FCRA]=, [Dispute Type?]=,

Here's my actual formula:

(count({<[Dummy] = {'0'}, dummy = {'1'}, Dummy = {'1'}, DateType = {'Created'}, CanonicalDate = {$(vTwelveRolling)}>} Pkey)

+

count({<Dummy = {'1'}, DateType = {'Created'}, CanonicalDate = {$(vTwelveRolling)}>} [Control Number]))

/

(
count({<[Dummy] = {'0'}, dummy = {'1'}, Dummy = {'1'}, DateType = {'Created'}, CanonicalDate = {$(vTwelveRolling)}>} Pkey)

+

count({<Dummy = {'1'}, DateType = {'Created'}, CanonicalDate = {$(vTwelveRolling)}>} [Control Number]))

When I insert $(vIgnore) to the bottom half of the formula, like so:

(count({< $(vIgnore) [Dummy] = {'0'}, dummy = {'1'}, Dummy = {'1'}, DateType = {'Created'}, CanonicalDate = {$(vTwelveRolling)}>} Pkey)

+

count({<$(vIgnore) Dummy = {'1'}, DateType = {'Created'}, CanonicalDate = {$(vTwelveRolling)}>} [Control Number]))

qlikview doesn't like it

swuehl
MVP
MVP

sunny_talwar

If you are seeing red wiggly lines, I think you need to ignore it because that is just the expression editor not understanding your syntax. Try clicking okay to see if it still works the way you would expect.

lucasdavis500
Creator III
Creator III
Author

No red wiggly lines, the next function Count() turns black, along with all my other fields in set analysis

sunny_talwar

I would still suggest clicking okay to check if you see any result or not

lucasdavis500
Creator III
Creator III
Author

Stefan, what is the difference between the way I have shown, and the link you provided? Why wouldn't the developer just do like I had done?

swuehl
MVP
MVP

If you are referring to the first link, that's a way to build the list of fields to clear dynamically (e.g. clear all fields from table Calendar, without hardcoding the field names).

If you are referring to the second link, that's just to say, don't take the syntax checker as highest judge, it's a quite imperfect tool.

swuehl
MVP
MVP

Duke Luke wrote:

No red wiggly lines, the next function Count() turns black, along with all my other fields in set analysis

If you use

='$(vIgnore)'

in a text box, what do you see?