Discussion Board for collaboration on QlikView Scripting.
I need to select multiple values in the single field
I have to reduce the data and save the file only with Japan and China.
Another file will be USA,Canada.
Country is the field is linked with other tables. I would like to do this filtering only in the macro.
Thanks in Advance for your help.
Go to Solution.
sub JapanChina ActiveDocument.Fields("Country").Select "(Japan|China)"
sub USACanada ActiveDocument.Fields("Country").Select "(USA|Canada)"
I am not very clear about why you want to use macro.
Are these statdard groupings or random?
Do you want to manually reduce the files or thru publisher?
Why not create another field for these groupings and use that field for the reducing of the files?
First am not sure the explanation is clear.
If you wish to reduce and save a file containing information for a particular country, why not reduce in the script, just have a WHERE clause, i.e. WHERE Country ='Japan' OR Country ='China'...
Also, if this is to prevent user from having access to other country's data then you can implement SECURITY read this blog by HIC, https://community.qlik.com/blogs/qlikviewdesignblog/2014/06/09/methods-for-data-reduction.
This are just general suggestion. If you can explain what you wish to achieve then someone from the community will give you more accurate suggestion.
Would Bookmark be another alternative?
Book mark and Where clause is not solve the problem.
I am looking for Macro to reduce the data .
Hi Jerry what if one of the fields has a space? i am struggling with one:
sub JapanSouthAmericaActiveDocument.Fields("Country").Select "(Japan|South America)"
An possibility would be to use multiple double-quotes like:
or you used toggleselect:
ActiveDocument.Fields("Country").ToggleSelect "South America"