Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Different results in a chart and in a textbox

Hello everyone,

I am facing a very weird thing. I have a chart (a table) like this:

Dim1      $(var1)

A             71

I have several "Dim1" but I have filtered on A so only one line appears. The expression is stored in a variable $(var1). var1 is a count of customers numbers with on condition in a set analysis.

If I remove the dimension Dim1 from the chart, then 71 goes to 69.  (Whereas there is a filter on Dim1 to keep only 'A')

What explains that ?

Please, let me know if I need to add details..

Thank you for your help

Laura

6 Replies
marcus_sommer

Your chart-expression will be calculated against a dimension even if there is only one dimension-value. The textbox-expression will be calculated without a dimension global against the whole data-set and this could be different.

- Marcus

Not applicable
Author

Thank you Marcus for your reply.

But as I said, I have filtered on the dimension (in the document) so to have it or not in the chart shoudln't make a difference, right ?

Not applicable
Author

Moreover, when I remove the dimension in the chart, I get a smaller figure.

marcus_sommer

Please post your expression. Further you could have differences if you calculates over key-fields.

Not applicable
Author

The expression is :

Count( {$< [Product closed]={0}>} if (Isnull (accountNumber), CustomerNumber, accountNumber))

I want to count the number of "accountNumber" that has a product which hasn't been cancelled.

The dimension is Product.

I have filtered on product A and according on if I put the dimension product or not in the chart, the figure changes..

Thank you for you help

marcus_sommer

Isnull() didn't worked often like expected, try instead:

if(len(trim(accountNumber)) >= 1, CustomerNumber, accountNumber)

and this are none key-fields? If yes, double the field within the script and use this double for the calculation.

- Marcus