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: 
Not applicable

Variables

Hi,

I'm working on a dashboard and created a table  in the visualizations.

I created variables and used them in my table.

If the content of my variable is:  round($(vTotal Revenue)/Count(DISTINCT(if([Billing Period] >= Parcel_Signature_Week,([Billing Period]))))*52,1)

I get a different result  if the content of my variable is: =round($(vTotal Revenue)/Count(DISTINCT(if([Billing Period] >= Parcel_Signature_Week,([Billing Period]))))*52,1)

The formula itself is correct.  The = sign seems to be what causes the difference in results within my table.

Can someone explain why I get 2 different results? Why does adding the equal sign change the output?

Thanks!

1 Solution

Accepted Solutions
andrei_delta
Partner - Creator III
Partner - Creator III

Hi Cindy,

When you are NOT using the "=" sign when writing a formula in the variable and then you call it in a chart, that's the moment when it gets evaluated.

When Using the "=", the variable already evaluates the expression and gets you a result (and from what i've seen the result is like a total or average of something, depending on your formula)  and when you call it in the table it brings you one value for the whole dimension.

I hope it helps!

View solution in original post

3 Replies
its_anandrjs

Better you can use this expression on variable

round($(vTotal Revenue)/Count(DISTINCT(if([Billing Period] >= Parcel_Signature_Week,([Billing Period]))))*52,1)


and then use variable in expression because when using AGGR key words with expression (SUM,COUNT,AVG...) equals sign by default puts above the expression.


Ex:-

Expression =$(vSum)


andrei_delta
Partner - Creator III
Partner - Creator III

Hi Cindy,

When you are NOT using the "=" sign when writing a formula in the variable and then you call it in a chart, that's the moment when it gets evaluated.

When Using the "=", the variable already evaluates the expression and gets you a result (and from what i've seen the result is like a total or average of something, depending on your formula)  and when you call it in the table it brings you one value for the whole dimension.

I hope it helps!

Not applicable
Author

Exactly the explanation I was looking for,  THANK YOU!!!!!!