Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare two charts with different calendar

Hi all.

I would like to create a tab where I have two straight tables and for each table there should be a calendar so I could compare those tables within different date periods. I have attached a excel to show how it could be visualized.

Is there anyone that have any suggestions how to solve this?

Thanks in advance! 

7 Replies
vincent_ardiet
Specialist
Specialist

Hi,

Have you had a look to the the alternate state functionality ?

It seems to offer something close to your need.

Regards,

Vincent

Not applicable
Author

Do you have any example?

vincent_ardiet
Specialist
Specialist

Are you familiar with Alternate states ?

If it's not the case, have a look to the help page in Qlikview (Alternates states and Examples of Alternates states).

Else, with the help of alternate states, you can have a single calendar table in your datamodel. You have to create an alternate state (document properties), for example called "State1".

Then, you create in double your listboxes for year, month and quarter and you assigned State1 to a year, a month and a quarter listboxes.

After that, you can make comparisons in your expressions with something like this :

sum([Nr Cust]) - sum( {$<[Year] = p({State1} [Year]), [Quarter] = p({State1} [Quarter]), [Month] = p({State1} [Month])>} [Nr Cust])

Regards,

Vincent

Not applicable
Author

Hello larsbjorn,

As Vincent suggests, alternate states is a very useful tool för this. Setting two different alternate states and assigning chart 1 to state A and chart 2 to state B will allow you to make selections in the calender (with different states) that only affects one of the charts.

This way you can make date selections in calender 1 and results will show in chart 1. At the same time you can make selections in calender 2 and results will show in chart 2 for comparison.

Alternate states are found under Document properties -> General -> Alternate states

Hope that was what you were looking for. Good luck!

Not applicable
Author

Hello.

I guess this function is only possible in version 11? I can't find it and I'm using version 10. Is there a way to do similar things in version 10?

vincent_ardiet
Specialist
Specialist

Hi,

Yes you're right, it's a new functionality in version 11.

In version 10, may be you can duplicate in your datamodel your calendar (with other column names using QUALIFY for example) but keeping the same KEY in order to join your fact tables with the two calendars.

Then, you can have listboxes coming from the two calendars.

And, in your expression (if your second calendar is called Calendar2), you can use Set Analysis like that (not tested) :

sum({$<[Calendar2.Year] = , [Calendar2.Quarter] = , [Calendar2.Month] = >}[Nr Cust]) - sum({$<[Year] = , [Quarter] = , [Month] = >}[Nr Cust])

Regards,

Vincent

Not applicable
Author

Hi,

Maybe you can use set analisis, set and set in your different table the year, no ?

Regards Fabien