Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

aniket_2701
New 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
Honored Contributor III

Re: Sales difference between two dates

aniket_2701
New Contributor

Re: Sales difference between two dates

Thanks for reply,

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

Thanks

qlikmeplease
Contributor III

Re: Sales difference between two dates

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
New Contributor

Re: Sales difference between two dates

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
Contributor III

Re: Sales difference between two dates

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
Honored Contributor III

Re: Sales difference between two dates

Like this ??

Please select calendar to find the sale

aniket_2701
New Contributor

Re: Sales difference between two dates

Thanks Ruan,

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

Please send me how it works.

aniket_2701
New Contributor

Re: Sales difference between two dates

How its works on Back end.

Thanks,

Highlighted
qlikmeplease
Contributor III

Re: Sales difference between two dates

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.