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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
d_koti24
Creator II
Creator II

Qvd's issue

Hi ,

I have 10 qvd's,taht qvd's contains year wise data,my req is I want to split that qvds into monthly wise qvds,that means each qvd splited into 12 qvds based on date field.instead of writeing script on every time ,I want create a subroutine and call that sub, pass the qvd name as a parameter.how to achive this?

Regards,

koti.

Labels (1)
5 Replies
vardhancse
Specialist III
Specialist III

Hi,

That can be done while creating the task in QMC by using loop and reduce option in Reduce<tab> of the QMc task, there we can define the field and value wise split, so that for every run the data will be splitted

jonas_rezende
Specialist
Specialist

Hi.

The link below will help subroutine.

https://community.qlik.com/thread/74568.

jonathandienst
Partner - Champion III
Partner - Champion III

Something like this:

ForEach vYearQVD in  ('..\QVDs\Sales_*.qvd')

  Let vYear = Right(SubField(vYearQVD, '.', 1), 4);

  For i = 1 to 12

      MonthQVD:

      LOAD * FROM [$(vYearQVD)] (qvd)

      WHERE Num(Month(TransDate)) = $(i);

      Let vFilePrefix = Date(MakeDate(vYear, i, 1), 'YYYYMM';

     STORE MonthQVD into [..\QVDs\Monthly\Sales_$(vFilePrefix).qvd'] (qvd);

     DROP Table MonthQVD;

   Next

Next

Assumptions:

  • Yearly QVDs are names Sales_YYYY.qvd (eg Sales_2014.qvd)
  • The yearly QVDs are in folder ..\QVDs
  • There is a date field in the QVD called TransDate
  • You want the monthly QVDs names Sales_YYYYMM.qvd
  • You want the monthly QVDs stored in ..\QVDs\Monthly


Adjust according to your specific requirements...


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Search the community, and you'll find lots of tips and tricks, and even solutions that are 90% complete.

Like: How to store the data of a table into Monthly and MonthEnd QVD's?

First load all your QVD's in a single resident table, then apply one of the solutions from that discussion.

Peter

d_koti24
Creator II
Creator II
Author

Hi jonathan,
I have a one qvd(sample.qvd),that qvd contains the one year data.per ex :apr2014 to mar 2015,
i want to split that qvd into monthly wise qvd like sample.4.2014.qvd,
                                                    sample.5.2014.qvd,
                                                           .
                                                           .
                                                           .
                                                     sample.3.2015.qvd
and store that qvd's in req loc(ex:d:/qvds/sampleqvds)

i want to achive this by using sub routine.and that two paths(sample.qvd,sample.4.2015)pass as parameters.
that means i want to pass the sample.qvd path and monthlyqvds stored path.

ex: call sub('sampleqvd path','monthly stored qvds path')

how to achive this?

can you please send me a sample app...

Regards,

kd