Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filtering a Gauge to show specific values?

I have a data source field containing job codes with a prefix of ‘C’, ‘I’ and ‘N’. Another field in the table reflects the hours spent against such codes.

On a ‘Gauge’, I can sum all hours against all codes no problem, but wish to;

Firstly, filter to show each code sum independently on a separate Gauge,

Next to show the cumulative sum of ‘C’ and ‘I’ codes on a gauge,

Finally, show the cumulative sum of ‘C’ and ‘I’ codes, excluding a specific ‘I’ code (I-0000123).

Most grateful for your advice on this as I am relatively new to Qlik.

 

1 Reply
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Steve,

What I would do is create a data island (with the status you want to see) like so

Codes:

Load * inline

[

    _Name

    C+I

    All

    C+I-0000123

];

and set it up above the gauge you want.

The expression would have a set analysis according to the selection made above

sum({<$(vSetCode)>}Values)

On the vSetCode variable, i'd set it with:

=if

(

GetFieldSelections(_Name)='All',

'Type=',

if

(

GetFieldSelections(_Name)='C+I',

'Type={"C","I"}',

'Type={"C","I"},Code-={"0000123"}'

)

)

Which would give me the options you want.

As a result, i'd have the following:

'All' selected

sample.png

'C+I' selected:

sample.png

'C+I-0000123' selected

sample.png

Attached the QVW I used.