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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rkpatelqlikview
Creator III
Creator III

How to use monthend qvd when new fields added in recent month qvd

Dear Team,

Here i am facing an issue with monthend sales qvd's.

Every month end am storing sales in (30-4-2019-sales) QVD and calling with    *-sales. It will call all the sales with existing months. But now suddenly new fields added in 5th month. now QVD name is  30-5-2019-sales. 

FROM [...QVDLOAD\MonthEnd\*-sales UAE.qvd]

Now i want take the data along with the new fields. how can merge this  fields data. 

Is there any way to put prefix FROM [$(QVDLOAD)MonthEnd\ >=30-5-2019Sales UAE.qvd]  ???

Thanks in advance.

 

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

I am not sure whether you want to dynamically add new fields or filter to load only May 2019, and later - but assuming a bit of both:

 

Result:
LOAD 0 as FileDate AutoGenerate 0;

For Each vFile in FileList('..QVDLOAD\MonthEnd\*-sales UAE.qvd')

	Let vFileDate = Num(Date#(TextBetween(vFile, 'MonthEnd\', '-sales UAE.qvd'), 'd-M-yyyy'));
	If vFileDate >= MakeDate(2019, 5, 30) Then
	
		Concatenate(Result)
		LOAD *,
			Date($(vFileDate)) as FileDate
		FROM [$(vFile)] (qvd);
	End If
Next

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
rkpatelqlikview
Creator III
Creator III
Author

This is typical and  good in real time scenario. Please let me know if any one not understand the query. 

bing_jville
Contributor III
Contributor III

Nothing is needed to done with the part - "FROM [...QVDLOAD\MonthEnd\*-sales UAE.qvd]"
I think the only change is in the loading script of the final app. e.g.
IF(QvdLoadDate>'01-05-2019', NewField, 'na') as NewField

Find a suitable date to use in the monthly QVD for this IF statement - IF older than May, load the value as nothing.
rkpatelqlikview
Creator III
Creator III
Author

Thanks for your response Bing, I understood but

What is this  QvdLoadDate? First of all in load script it will not take, will through error. Can you please give me a clarity on this?

jonathandienst
Partner - Champion III
Partner - Champion III

I am not sure whether you want to dynamically add new fields or filter to load only May 2019, and later - but assuming a bit of both:

 

Result:
LOAD 0 as FileDate AutoGenerate 0;

For Each vFile in FileList('..QVDLOAD\MonthEnd\*-sales UAE.qvd')

	Let vFileDate = Num(Date#(TextBetween(vFile, 'MonthEnd\', '-sales UAE.qvd'), 'd-M-yyyy'));
	If vFileDate >= MakeDate(2019, 5, 30) Then
	
		Concatenate(Result)
		LOAD *,
			Date($(vFileDate)) as FileDate
		FROM [$(vFile)] (qvd);
	End If
Next

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
rkpatelqlikview
Creator III
Creator III
Author

Hi Jontydkpi,

Thanks for your response. Yes I need dynamically. If any changes happen in new QVD, it should take automatically from existing QVD also. 

I will try with script which you have provided. 

Thanks for guidance.