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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dydrmr
Contributor
Contributor

Apply Alternate States to a Straight Table

Hi Everyone,

I have recently started working with QlikSense and need some advice.

I am developing a report that includes the following components:

  1. A list of dimensions
  2. A list of measures
  3. A straight table
  4. Other filter panes

The goal of the report is to allow users to select any dimension and measure, and automatically compute the variance between the same measures across different periods.

Example:

  • Dimension: Region
  • Measure: Total Debt
  • Alternate State: Variance A (as of 2023)
  • Alternate State: Variance B (as of 2024)
Region Total Debt as of 2023 Total Debt as of 2024 Variance
R-123 709,377 9,041,334 8,331,957
R-456 12,644,071 12,652,790 8,719
R-789 1,243,130 1,198,923 -44,207

Formula used per field:

  • =SUM({[Variance A]} [Total Debt])
  • =SUM({[Variance B]} [Total Debt])
  • SUM({[Variance A]} [Total Debt]) - SUM({[Variance B]} [Total Debt])

Additionally, the dimension and measure list, straight table, and other filter panes are under the alternate state <default>. The issue arises when applying filters from the other filter panes; the filters only reflect on the "Total Debt as of 2023" column. For instance, if the filter pane includes the Region dimension and selects only R-123 and R-789, it should display only these two regions across all columns in the straight table.

Is it possible to enable the filters to apply to all columns in the straight table? If so, how can this be achieved?

Thank you in advance for your assistance.

Labels (6)
3 Replies
nevopotokcloudinary

 

Hi @dydrmr,
Great to see you diving into alternate states in Qlik Sense — they can be powerful for comparative analysis.

To apply an alternate state to a straight table:

  1. Go to the Properties Panel of the table.

  2. Under "Alternate State", select or create a state (e.g., StateA).

  3. Any filters you apply using objects or listboxes in the same state will now affect this table independently of the default state.

Don't forget: your set analysis inside expressions may also need to reference the state explicitly, like:

 

 
Sum({StateA}<Year={'2024'}> Sales)

 

agigliotti
Partner - Champion
Partner - Champion

Hi @dydrmr ,

You should use the below syntax:

SUM( {[Variance A]*$} [Total Debt] )

I hope it can help.

Best Regards

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @dydrmr 

Why do you need alternate states at all?

It looks to me that all you want is to have 2 extra column filtered down to particular periods which does not require you to have alterante states.

Cant you just use:

  • =SUM([Total Debt])
  • =SUM({<Year = {set to set year for variance A}>} [Total Debt])
  • =SUM({<Year = {set to set year for variance B}>} [Total Debt])
  • etc...
  •  
cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.