Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to Reduce Data after Reload

Using QlikView 8.5. I would like to execute a reduce data command after reloading a template. I have created a macro which makes some selections on the data and then attempts to reduce data. I have then attached that macro to the OnPostReload event trigger.

sub AfterReload

ActiveDocument.Fields("SubRegion").Select "NNI")

ActiveDocument.Fields("SubRegion").ToggleSelect "ENI")

ActiveDocument.ReduceData

end sub

The selection part of the macro works fine but the macro editor pops up at the ReduceData line. If I then save the template and re-open it I can successfully run the AfterReload macro without any problem. I have also noticed that after the reload, I cannot use the File / Reduce Data / Keep Possible Values command - no errors, just nothing happens.

This is really frustrating and any suggestions would be gratefully received.

Thanks, Kevin Long









3 Replies
Not applicable
Author

I have a lot of QVW files, how should I batch reduce data?

IAMDV
Master II
Master II

Have you considered using Publisher?

Thanks,

DV

www.QlikShare.com

msteedle
Partner - Creator
Partner - Creator

Your script worked fine for me, albeit in v11. The only issue was that you have extraneous closing parentheses at the end of each of your selection lines.