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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vinod2086
Creator II
Creator II

how to get previous years data in separate CSV file

Hi Friends,

i need help actually am using one source file that contains 2012, 2013,2014,2015 years data i have created straight  table loaded all the data and for user friendly i have created macro for CSV file. till now its no issue's but user asking for new csv file that contains only 2012 and 2013 years data.

please help is there any condition for macro.

3 Replies
avinashelite

Hi Before exporting you can select the required year rite?? and then use the below macro

Sub exp()
set obj = ActiveDocument.GetSheetObject("CH01")

obj.ExportBiff "C:\test.csv"
End Sub

this should do...or create a separate button with action to select the year's you required and then trigger the  macro export

vinod2086
Creator II
Creator II
Author

Hi Avinash,

Thanks for reply that is fine, instead of creating separate sheet is there any possibility to apply filter at macro level.

avinashelite

not sure , try like this: Create a field with required year or set values in the E

Sub exp()

ActiveDocument.GetApplication.WaitForIdle

set LB=ActiveDocument.GetSheetObject("List Box ID")

LB.Activate

E=LB.GetPossibleValues

i=lbound(E)

ActiveDocument.Fields("Field name").select E(i)

set obj = ActiveDocument.GetSheetObject("CH01")

obj.ExportBiff "C:\test.csv"

End Sub