Now this does give me what I want, each time I press a button it will only give me data for that department.
The issue - If I select the "MARKETING" button, it'll give me the table with MARKETING revenue information. The issue is that I also see ACCOUNTING and IT as part of the table although I thought I excluded it in my set analysis by using the variable definition. It also shows 0 as data points for the other 2 departments. Is there a way to completely leave out data points for the other 2. It can be confusing for an end user to click MARKETING and also see the other departments with null data points.
You don't need variable buttons and set analysis to do this; this is standard Qlik filtering functionality. Add a filter bar with Service; it will list your three options. Upon selection the data will filter to just that Service.
I understand what you’re saying. This is more of an aesthetic feature I’m trying to implement and help users navigate to their granular report based on a push of button with the lowest amount of mouse clicks.
Rather than set analysis you might just try calculating the dimension, something like this:
=if(vDept = 'A', 'A', if(vDept = 'B', 'B'))
Then to make it all tidier, make sure you exclude null values from your dimension and set your measure "show column if" property to something like: len(vDept) > 0 That will mean the table is blank until the user selects a variable value which will be a bit neater. (note, I've assumed that you've defined the variable without a default value).
Maybe an even neater and simpler way to achieve the same thing would be just to have a normal selection list of departments and then use the "show column if" property of your measure to only display when GetPossibleCount(department) = 1.