Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
erhardt_dekock
Contributor III
Contributor III

Variable not reloading or ignored in expression

Hi all, newbie to the forum. Hope you guys can assist me.

Please find attached my qvw example and the data file.

What I want to calculate in this model is the Price difference for New and Discontinued (Disc) products between two Date periods. The two Date periods are represented by the states Post Period (PP) and Now.

A New product is a product that was sold in the Now period and not in the PP period. A Discproduct is a product that was sold in the PP period but not in the Now period.

I created two variables called vPrevYear and vNowYear. The new SKU/Disc table is set for the Now state and therefore calculates the sum of the price in the Now period. Multiplying this with the flag for when a product are New or Disc, gives me the value I want for a New product.

To get the price difference I need to subtract the sum of the price of Disc products. This sum of the Disc products prices are calculated in the variable vNewSku and then subtracted in the new SKU/Disc table Expression.

The value of "new SKU/Disc" must be the same as the total "new SKU/Disc" in the Price Table. When I tested it, the variable is not subtracted as specified in the expression.

The problem with the variable can be observed in the Input Box. I have attached two screen shots showing the same selection but different values. The variable SOMETIMES becomes zero and SOMETIMES it is correct. There is no sequence of selections I can find to reproduce this error. Just select and deselect the Department a few times and it SHOULD occur.

I do not believe the error lies in the dimension, since I use a dummy dimension in order to only calculate the total values of the price by aggregating by product.

1 Reply
swuehl
MVP
MVP

I was not able to reproduce your issue. Which QV version are you running?

I can only guess that you might have issues with the Select - Select in field action triggered on field Department changes.