Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Anonymous
Not applicable
Author

Thanks for reply,

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

Thanks

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
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

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Thanks Ruan,

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

Please send me how it works.

Anonymous
Not applicable
Author

How its works on Back end.

Thanks,

Anonymous
Not applicable
Author

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.