Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
aniket_2701
Contributor
Contributor

Sales difference between two dates

Hello,

Guys I have date data,Need to find difference between two selection date .

Ex: 1/1/2015 till 1/12/2015

Need to find Sales between,if date 1/1/2015 to 1/5/2015 range sales.Without using set analysis.

I upload excel data.

Please help.

10 Replies
prma7799
Master III
Master III

aniket_2701
Contributor
Contributor
Author

Thanks for reply,

But i already search this post,Please Using variable function maxdate and mindate.

Thanks

qlikmeplease
Creator III
Creator III

Hi Aniket,

Please let me know what exactly you want to do.

Firstly, I see the raw data has different Date formats.  Please use the below expression to correct this.

Date(alt(Date(Date),MakeDate(SubField(Date,'/',3),SubField(Date,'/',2),SubField(Date,'/',1)))) as Date

aniket_2701
Contributor
Contributor
Author

I have just given simple date excel sheet, which contain Date 1/1/2015 to 9/7/2017.

My question is, If i select date between 1/1/2015 till 1/5/2015, So date will show sales of between these date range.

Condition: Using maxdate and mindate function (Variable)

I hope explain it clear.

Thanks

qlikmeplease
Creator III
Creator III

If you convert the dates to the correct format, and add these into a listbox you will get the desired result by just selecting the relevant dates, and creating an expression SUM(Sales)

Capture.PNG

Does this answer your question?  If you want Max and Min Dates you will have to do the changes in the script.

prma7799
Master III
Master III

Like this ??

Please select calendar to find the sale

aniket_2701
Contributor
Contributor
Author

Thanks Ruan,

It is the correct answer,But how you get this.

Please send me how it works.

aniket_2701
Contributor
Contributor
Author

How its works on Back end.

Thanks,

qlikmeplease
Creator III
Creator III

Copy the below Script:

LOAD Country, Date(alt(Date(Date),MakeDate(SubField(Date,'/',3),SubField(Date,'/',2),SubField(Date,'/',1)))) as Date, Sales

FROM [..\..\Date sample.xls] (biff, embedded labels, table is Sheet1$);

Just change your path.

And on the frontend , add Country and Date in Listboxes and make your selections.

Hope this helps. Please mark as helpful or correct if it works for you.