Discussion Board for collaboration related to QlikView App Development.
Hoping someone can help. I've got a variable which is populated by a text string (department name containing a comma) upon a click of a button. This variable is then fed into a chart expression to customise a bar chart by specifying the department held in the Department field. Whilst this worked when the abbreviated names were used (with no spaces or commas), now it doesn't even though single quotes have been included. Please see below.
Expression in Chart:
=count({<Department={$(vDisplayDepartment)}>} [Staff ID])
Department Names stored in variables vDepartment1, vDepartment2 and vDepartment3 via the Document Settings > Variables Tab and are populated in the following format. ='Department of Business, Law and Communication'
Upon the click of the department button the variable vDisplayDepartment=vDepartment1 (the latter determined upon which button is clicked.
Like I said however, when I click the button the chart simply states there is no data to display.
Can anyone help?
Appreciated.
Matt
I think both:
vDisplayDepartment=vDepartment1
and
{$(vDisplayDepartment)}
will fail because of missing quotes and/or spaces in the content.
I suggest to remove this logic and to use just selections within the field Department and should there really a good reason of using a second source to select the values to switch the variable/button approach to an additionally field-selection like:
ExtraDepartment:
load * inline [
ExtraDepartment
Dep1
Dep2
...
];
and then within the expression:
count({<Department=p(ExtraDepartment)>} [Staff ID])
- Marcus
I think both:
vDisplayDepartment=vDepartment1
and
{$(vDisplayDepartment)}
will fail because of missing quotes and/or spaces in the content.
I suggest to remove this logic and to use just selections within the field Department and should there really a good reason of using a second source to select the values to switch the variable/button approach to an additionally field-selection like:
ExtraDepartment:
load * inline [
ExtraDepartment
Dep1
Dep2
...
];
and then within the expression:
count({<Department=p(ExtraDepartment)>} [Staff ID])
- Marcus
p() and e() are special set analysis functions which return the possible respectively the excluded field-values of the specified field.
- Marcus