Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Not applicable

Compare two time periods

Hello,

I need to ask for assistance with how to create script for comparing two time periods. Here's what I'm hoping to do...

I would like the end user to be able to select what data comparisons they need to see. Here are examples of some of the comparisons the end user may want to do:

1) Compare cost for "Q2 for Y1" to "Q1 for Y1" (i.e. Q2 2014 in one column and Q1 2014 in another column)

2) Compare "Q2 for Y1" to "Q2 for Y2" (i.e. Q2 2014 in one column and Q2 2013 in another column)

3) Compare two consecutive months.

4) Compare a month between two years

5) Compare 6 months from one year to 6 months from another year

Basically I need to create flexibility where the end user can choose how they look at the data. I can keep it to a few choices if that's easier.

Critical choices to include:

1) Consecutive month over month.

2) Consecutive quarter over quarter

3) Consecutive year over year

4) 6 months over previous year's same 6 months.

Is there standard script that I can add?

Thank you, thank you, thank you in advance:)

Tags (3)
1 Solution

Accepted Solutions
Employee
Employee

Re: Compare two time periods

very strange...  Here is a Dropbox link

Dropbox - dates.qvw

-Josh

View solution in original post

11 Replies
Employee
Employee

Re: Compare two time periods

Hi Barb,

To give the maximum flexibility to the users I would recommend using alternate states.  This will allow the users to select any date and compare it to any other data.  The disadvantage of this approach is it give so much choice so you may want to create buttons that jump to specific selections.  Here is an example of both.

-Josh

Qlik

Not applicable

Re: Compare two time periods

Hi Josh - I am not seeing your examples. Did you mean to include a file?

Employee
Employee

Re: Compare two time periods

Hi Barb,

Are you not seeing a QVW attached to my post? (I'm seeing it when I look at the posting).

-Josh

Not applicable

Re: Compare two time periods

I don't see it with your original reply but I see it here with this reply. Weird. I will take a look.

As a side note...I recently implemented your Master Calendar example...the one where you posted a video. Oh my gosh you are so incredibly helpful. THANK YOU!!!! I am completely learning QlikView on my own and have no prior experience with any of this so I rely on the Qlik Community a lot. Since I have your ear I wanted to just let you know that I really appreciate your assistance and expertise and you definitely make an impact in the Qlik Community. You're awesome!

Not applicable

Re: Compare two time periods

...and oh shoot...I just realized the file I saw copied in your last post is just a screen shot. I still am unable to see and click on the file attachment.

Employee
Employee

Re: Compare two time periods

very strange...  Here is a Dropbox link

Dropbox - dates.qvw

-Josh

View solution in original post

Not applicable

Re: Compare two time periods

This is what I see

Not applicable

Re: Compare two time periods

Hi Barb,

To give the maximum flexibility to the users I would recommend using alternate states.  This will allow the users to select any date and compare it to any other data.  The disadvantage of this approach is it give so much choice so you may want to create buttons that jump to specific selections.  Here is an example of both.

-Josh

Qlik

Not applicable

Re: Compare two time periods

Josh, I see that you have to select Alternate State as DateCompare. How does this work if I'd like to compare two different product groups?