Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for
Did you mean:
Contributor III

## Filtering measures created with alternate states

Hello, I have what I hope to be a simple problem:

I created two alternate states:
Period1
Period2

I then added the same period dimension to my sheet twice as filter panels and applied the alternate state to each.

I created the following variance measure:
Sum({Period1}[Sales Amount USD]) - Sum({Period2}[Sales Amount USD])

This works perfectly and shows me the total sales amount variance between whatever period(s) that I select from the filter panels. This gives flexibility to do several different time period variances without creating multiple set-analysis expressions.

However, now I have the simple request to filter the data. For example, say I want to filter by a country (i.e. US or Canada). How can I filter these measures further?

Labels (1)
• ### General Question

1 Solution

Accepted Solutions

Assuming you are making the other selections, like Country, in the default state, just include the default state with the intersection operator:

Sum({Period1 * \$}[Sales Amount USD]) - Sum({Period2 * \$}[Sales Amount USD])

If you want to make sure your period selections only come from the alternate states, add set modifiers as shown here:

https://qlikviewcookbook.com/2016/07/alt-states-merged-selections-tip/

-Rob
http://www.easyqlik.com
http://qlikviewcookbook.com

2 Replies

Assuming you are making the other selections, like Country, in the default state, just include the default state with the intersection operator:

Sum({Period1 * \$}[Sales Amount USD]) - Sum({Period2 * \$}[Sales Amount USD])

If you want to make sure your period selections only come from the alternate states, add set modifiers as shown here:

https://qlikviewcookbook.com/2016/07/alt-states-merged-selections-tip/

-Rob
http://www.easyqlik.com