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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing Dates

I have a request from a customer to be able to compare sales data from a given time period. They want to be able to compare any particular date chosen from 2 different list boxes. What I have done is put the data in 2 different tables and added 2 seperate list boxes to the sheet. I have loaded 2 different date fields into the document. Although they contain the same values the field names are different. How do I get 1 table to display the values chosen from 1 listbox and the other table to display the values chosen from the second list box?

17 Replies
Not applicable
Author

The Date fields should have the same name

Not applicable
Author

Then how do I specify which table relates to the specific date chosen in the list box?

Not applicable
Author

For example....

I want Table1 to show data related to June 2009 which would be chosen in ListBox1. Then I want Table2 to show data related to June 2010 which would be chosen in ListBox2.

Not applicable
Author

To compare different periods you can use Set Analysis.

For your example:

1. pick a June month from your calendar

2. first expression for 2010 is sum({$ <Year={"2010"}>} Value)

3. second expression for 2009 is sum({$ <Year={"2009"}>} Value)

Not applicable
Author

Thanks I believe that is what I am looking for. I will try it out and let yopu know. Thanks again.

Not applicable
Author

I think I am doing something wrong. I have added the expression to the pivot tables, but my problem is that when I choose 2009 in one list box the other list box value changes also. How can I make it to where the data is pretty much unrelated. No matter what I do it's like whatever date I select for either list box everything on the sheet changes to that specific date. What am I doing wrong??? I apologize and I know this is probably pretty basic, but I am fairly new to QlikView.
Not applicable
Author

in the development environment, click on the table viewer icon. (or, go to the 'File' menu, and select 'Table Viewer') it will show you how your tables are related. You can use it to identify the field that is causing the join, and then you can modify your script to prevent it.

On a somewhat related note, it sounds like you're going about satisfying your requirement in a very inefficient way. you could accomplish what you're attempting through the use of variables, set analysis, and a single set of related tables.

Not applicable
Author

My data is coming from only 1 Table in the database and so there are no joins. I have a small sample application created to show what I want to do. Is there a way to send that or attach it to the thread???

Not applicable
Author

In the posting window (not the quick post, but the full reply, or edit window) click on the options tab at the tob, and you can attach your file there.