Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Employee
Employee

Ignore all Filters

I inherited the following code and need to have it ignore all filters.  I have tried multiple options including the one you see there now and nothing seems to work.

If(Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear))"}>} ClaimID)<>0,
Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear))"}>} ClaimID),
If(Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+1)"}>} ClaimID)<>0,
Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+1)"}>} ClaimID),
If(Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+2)"}>} ClaimID)<>0,
Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+2)"}>} ClaimID),
If(Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+3)"}>} ClaimID)<>0,
Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+3)"}>} ClaimID),
If(Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+4)"}>} ClaimID)<>0,
Count({1}TOTAL <$1> {<Year={"$(=Min(MinYear)+4)"}>} ClaimID),0
)))))

2 Replies
Partner
Partner

Re: Ignore all Filters

Is the "$1" needed because this is a variable function? If not, we don't need it.

You will also need to add the total and set analysis to the min function within the set analysis. Also, you may want to look into the ALL keyword, it might meet your needs.

If(Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear))"}>} ClaimID)<>0,
Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear))"}>} ClaimID),
If(Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+1)"}>} ClaimID)<>0,
Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+1)"}>} ClaimID),
If(Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+2)"}>} ClaimID)<>0,
Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+2)"}>} ClaimID),
If(Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+3)"}>} ClaimID)<>0,
Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+3)"}>} ClaimID),
If(Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+4)"}>} ClaimID)<>0,
Count({1}TOTAL {<Year={"$(=Min(total {1} MinYear)+4)"}>} ClaimID),0
)))))

 

You may want to try and refactor this expression entirely though. I imagine it is not performant. Maybe something like this: 

Count(ALL {<Year = {'$(=min(ALL {<Year = {"Count(ALL CLAIMID)>0"}>} Year))'}>} ClaimID)

 

Blog: WhereClause   Twitter: @treysmithdev
Employee
Employee

Re: Ignore all Filters

As of right now I do need the variable parameter unless you have a better way.

I have a separate chart for each of Actions and Actors.  So the totals need to be by these values only in each chart.  For example Actions would be things like Hacking, Malware, etc. 

Let me know if that makes sense.

Thanks