Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Raju_6952
Creator III
Creator III

Making Status as a Filter

Hi,

I am using =Count (DISTINCT IncidentID) > 0, 'True', 'False') to find the status of it.but I need to set it as Dimension filter to make the selections.

 

Thanks in advance.

 

Labels (1)
1 Solution

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

If you need to evaluate for another dimension whether IncidentIDs exist, you can use

=Aggr(If(Count(DISTINCT IncidentID) > 0, 'True', 'False'), YourDimension)

to apply a filter to your dimension for all values that do or don't have IncidentIDs.

View solution in original post

4 Replies
BrunPierre
Partner - Master II
Partner - Master II

Like this

=If(Aggr(Count(DISTINCT IncidentID), IncidentID) > 0, 'True', 'False')

LRuCelver
Partner - Creator III
Partner - Creator III

If you need to evaluate for another dimension whether IncidentIDs exist, you can use

=Aggr(If(Count(DISTINCT IncidentID) > 0, 'True', 'False'), YourDimension)

to apply a filter to your dimension for all values that do or don't have IncidentIDs.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Raju_6952 

Aggr works for this, but for performance you really want to do this in the load script.

If you just add a new field to the load of your Incident table you can have a filter with just yes:

Incident:
LOAD
   IncidentID,
   'Yes' as [Has Incident],

If you need to know if a particular site has an incident or not, and you want to have Yes/No filters you can do this with an ApplyMap statement. Assuming you have loaded an Incident table, which has ClientID, ahead of your Site table:

Map_HasIncident:
MAPPING LOAD DISTINCT
   ClientID,
   'Yes' as Incident
RESIDENT Incident;

Site:
LOAD
   SiteID,
   ApplyMap('Map_HasIncident', SiteID, 'No') as [Site Has Incident],

Your users will thank you for pre-calculating this in the load, rather than having to evaluate it at run time for a filter pane.

Hope that helps,

Steve

Raju_6952
Creator III
Creator III
Author

Hi,

=Aggr(If(Count(DISTINCT IncidentID) > 0, 'True', 'False'), YourDimension)

 

The above formula is working. Thanks for the replies. 

Kind regards,

Raju