Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I need to fetch the data from multiple qvds on year wise.As of now I have the solution that if in target folder path suppose 10 qvds are there we can simply do that and currently i need data only for last two years I will get this thing by using concatenate wala thing
target qvd - 10
o/p - two qvds needed
DATA:
LOAD
A,
B
FROM ....KK12016
CONCATENATE
DATA1
LOAD
A,
B
FROM ....KK2017
But this is static/manual activity for current result,I wanted to get the data like if current year is 2017 it should pick up 2016 and 2017
qvd when year 2018 will come at that time it should pick up 2017 and 2018 data ..so on,My current files ar saving in the belwo format
Path:--D:\Local Drive\Qlik_View\
FileName1:-KK_2000.qvd
FileName2:-KK_2001.qvd
FileName3:-KK_2013.qvd
FileName4:-KK_2014.qvd
FileName5:-KK_2016.qvd
FileName6:-KK_2017.qvd
Regards,
KK
Hi,
You can try this.
For i=0 to 1
Let vYear =Year(Today()) - $(i);
Data:
Load * from KK_$(vYear).qvd(qvd);
Next
Regards,
Kaushik Solanki
Hi,
You can try this.
For i=0 to 1
Let vYear =Year(Today()) - $(i);
Data:
Load * from KK_$(vYear).qvd(qvd);
Next
Regards,
Kaushik Solanki
May be the below script might help you
LET vNoOfYears = 2;//No of years to be taken
LET vMaxYear = Year(Today());//Max Year
LET vFileNamePrefix = 'FileName1:-KK_';//if it has to be any filename means use *
for i=vMaxYear-vNoOfYears+1 to vMaxYear
LOAD '$(vQvdPath)$(vFileNamePrefix)$(i).qvd' as QVDFileName
AutoGenerate 1;
LOAD *, $(vMaxYear) as QVDYear
From [$(vQvdPath)$(vFileNamePrefix)$(i).qvd] (qvd);
next i
Thank you so much sir for always helping during project delivery time
Pleasure.
Regards,
Kaushik Solanki
Buddy I just saw but I think you have got the answer.
s buddy