Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

show partial sums with a macro

Trying to figure out how to show and not show partial sums in a pivot table via a macro.

I have a pivot table that allows users to add dimensions and expressions dynamically ( Thanks Orka)

I am going to upload Orka example qvw to work from. Once a user selects their dimensions I would like them to be able to select which dimensions to show the partial sums on.

I have included the start of a new macro called ShowPartialSums. I need some help on how to make this more dynamic.

Thanks

1 Reply
Not applicable
Author

just add this to the macro

' Add Partial Sums

    ActiveDocument.GetApplication.WaitForIdle 'wait for QlikView to finish before modifying report

set selectedExpressions = ActiveDocument.getField("%ExpName").getSelectedValues
set selectedDimensions  = ActiveDocument.getField("%Dimension").getSelectedValues
selectedExpressionMax   = selectedExpressions.Count -1
selectedDimensionMax= selectedDimensions.Count -1
if  selectedExpressionMax > -1 then
        set chartProperties  = chart.GetProperties
        for i = 0 to selectedDimensionMax
            chartProperties.dimensions(i).showpartialsums = true
              chart.SetProperties chartProperties
        next
    
    end if