QlikSense variable have limitations and not quiet flexible as QlikView but we can use the variable in a robust way with little tweaks and tricks. For example, the below variable declaration can be used in charts with buttons.
Create an Inline Load with the name of the fields as text
LOAD * INLINE [
Create an expression in the Variable as follows
vDivision = If(Value=1,Division,If(Value=2,Company)) (Attached Screen Short for reference)
Use the Navigation Buttons from QlikSense branch to declare the Filedname_v, Please follow below link to download from Qlik Branch
Sheet Navigation and Action Button: Qlik Branch
Turn on the Actions before navigating and select Value in Field from the First Action drop down menu
Declare the Field value to FieldName_v and Value to ='Company' ; Label the value to Company in the Layout (Attached Screen Short for reference)
Please refer the same for creating Division Button.
Drag and drop the chart required and include the below expression in the Dimensions label
Null() is defined here for example purpose.
Include the measure label as required, we are taking Net Premium in our example
Now, we can drive the dashboard based on the button selection. The chart responds based on the button selection.
I have attached a sample application, Hope it helps.