Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
one of our customers has a strange problem with using bookmarks and macros on a QlikView application via AccessPoint.
I'll try to explain myself, starting with the case that works.
If I access the application with the user who is also the user of the services (I don't know if it can be useful as information) everything works. In detail: I access the sheet where there is a ListBox for choosing the dimensions and measures to represent in the table, I choose dimensions and measures and select, again via the ListBox, for which dimensions to enable the totals in the Pivot table. This last selection is managed by a macro. At this point, if I create a bookmark while the totals view is active, close and reopen the application by selecting the previously created bookmark, my pivot table presents the data with the total.
If I log in to the application with any other user and follow the same steps, once I apply the bookmark I do not see the totals. It does this behavior with all users except the service user.
I attach some images.
Let me know if you need any other information.
Thanks
Hi
Can I ask is the bookmark you created a document bookmark and therefore available to all users or a user bookmark available only to the user who created it?
Hi Brian,
each user creates his own bookmark, they are not shared.
How does the macro contribute to the display of the totals? Do you have section access? Also, have you try with any other admin or high privilege user? Does it work? When does it not work, is for one user only or any user that is not the services account?
Macros aren't meant to work in Ajax mode, so the only surprise here is that it's working for the service user...
https://support.qlik.com/articles/000045380
Yes, there is section access.
The problem affects all users, ADMIN and USER, it only works with the service user.
I recommend replacing the macro with something else. Can you post the macro code for us to take a look?
Yes, sure.
Unfortunately it is a macro that we inherited, the comments are in German which is not my language.
sub MOSTRATOTALI
dim chart, prop, dims, pSums, str, i, j 'Variablen deklarieren
set doc = ActiveDocument
set pSums = doc.Fields("DIMENSION_TOTAL").getSelectedValues 'selektierte Werte vom Auswahlfeld in ein Array einlesen
set chart = doc.GetSheetObject("CH53") 'Pivot auswählen
prop = chart.GetProperties 'Zugriff auf Eigenschaften
set dims = prop.Dimensions 'Auswahl der Dimensionseigenschaften
for i = 0 to dims.Count - 1 'Pivotdimensionen durchlaufen und auslesen
dims(i).ShowPartialSums = false 'für alle Dimensionen die Teilergebnisse rausnehmen
for j = 0 to pSums.Count - 1 'selektierte Werte des Auswahlfeldes werden durchlaufen und ausgelsen
if dims.Item(i).Title.v = pSums.Item(j).Text then dims(i).ShowPartialSums = true 'Vergleich des Auslesens + setzen des Teilergbenis
next
'str = str & dims.Item(i).Label.v & chr(10)
next
chart.SetProperties prop 'Zuweisung der Sichtbarkeiten für die Teilergebnisse für die Dimensionseigenschaften der Pivot
set doc = nothing 'Variablen löschen
set pSums = nothing
set chart = nothing
set dims = nothing
end sub
Ok, let's go one step at a time. I know a little German, so here is your macro with the comments in English:
Sub MOSTRATOTALI
Dim chart, prop, dims, pSums, str, i, j 'Declare variables
Set doc = ActiveDocument
Set pSums = doc.Fields("DIMENSION_TOTAL").getSelectedValues 'Read selected values from the selection field into an array
Set chart = doc.GetSheetObject("CH53") 'Select the pivot table
prop = chart.GetProperties 'Access properties
Set dims = prop.Dimensions 'Select dimension properties
For i = 0 To dims.Count - 1 'Loop through pivot dimensions and read them
dims(i).ShowPartialSums = False 'Remove partial sums for all dimensions
For j = 0 To pSums.Count - 1 'Loop through selected values from the selection field and read them
If dims.Item(i).Title.v = pSums.Item(j).Text Then dims(i).ShowPartialSums = True 'Compare read + set partial result
Next
Next
chart.SetProperties prop 'Assignment of visibilities for partial results for the dimension properties of the pivot
Set doc = Nothing 'Delete variables
Set pSums = Nothing
Set chart = Nothing
Set dims = Nothing
End Sub
Second a few ideas to do the same without using a macro:
1. Use Variables and Button States: Create variables that represent the selected values in your selection field. Then use these variables in the expressions of your pivot table to filter the data. You can use buttons to allow the user to select values and update the variables accordingly.
2. Use Conditional Selections in QlikView: You can use conditional expressions in the properties of your pivot table to control the display of subtotals based on the selected values in your "DIMENSION_TOTAL" field.
These approaches can help you achieve the same result without needing to use macros.