# New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a \$200 Amazon Gift Card! Watch Video
cancel
Showing results for
Did you mean:
Contributor III

## Switching between 2 different time dimensions

Hi everyone,

In our company, each record in the database has several time dimensions, each one reflecting a different phase of the transaction.

Currently I have one listbox containing one of these dates.

I'd like to allow my users to easily toggle between these date dimensions, and see how the data changes between each perspective.

Is there a way to allow toggling between dimensions while using the same charts, and ideally even use the same listbox which will display the chosen time dimension?

I hope this makes sense.

Thanks a lot,

Assaf

1 Solution

Accepted Solutions
MVP

Hi,

one example of this solution:

hope this helps

regards

Marco

8 Replies
MVP

You can use a calculated dimension for your chart:

If(vTog = 0, TimeDim1, TimeDim2)

and you can use an expression for your list box as well

If(vTog = 0, TimeDim1, TimeDim2)

You will need to create a button with an action to toggle vTog between 0 and 1

I hope this helps.

Best,

Sunny

MVP

A Calculated Dimension would work, but could be inefficient.

Instead you could have both dimensions in your chart and make them conditional dependent on your toggled variable.

Contributor III

why would it be inefficient?

and also - how do you use that strategy when needing to switch between these dimensions in expressions?

MVP

Because Calculated Dimensions are re-evaluated every time a user clicks anything.

MVP

I don't think you will need to make any changes to your expression if the expression itself doesn't need any change. So if you want to see Sum(Sales) by two dimensions (one at a time), you can use a calculated dimension or conditionally hide/show dimension and use just one expressions Sum(Sales). But in case you want to see Sum(Sales) with one dimension and Count(Sales) with another then you will need an if statement expression or two expression which hide/show conditionally.

There are a lot of options available, you just need to see what works best for you.

Best,

Sunny

MVP

Hi,

use a crosstable load to create a canonical date and derive a canonical date calendar from it. Doing so you will get a DateType field your users can use to switch between the different dates.

Canonical Date

hope this helps

regards

Marco

MVP

Hi,

one example of this solution:

hope this helps

regards

Marco

Contributor III

Thank you Marco for the detailed answer, this solves my problem!

Tags