Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm new in qlikview making my first steps into this world of magic.
I'm trying to make a count of occuring products in a product table in a listbox, count per type of product.
Seems to work fine if I use the count as an expression in the listbox object.
My expression in the listbox oblect : Count (Product_ProductType_Code)
Now I want to replace this by a variable to be able te reuse it.
So I've created a variabel containing this expression :
And then use this variable in my listbox expression.
But I get a different result as shown below (left = count in listbox expression, right is using variable in listbox expression).
In the result using the variable I get a total count of all products instead of a count on product type.
I expected the results to be the same but it's not.
What am I doing wrong?
Thanks for any help in understanding this.
Hugo
Hi Hugo,
In your variable, remove the = sign at the beginning - what this tells Qlikview is to calculate the value globally, so it will return a total.
If you're storing it as text, when you then reference it in your listbox, include a DSE (dollar sign expansion) to calculate the expression you're storing.
So your variable is Count(Product_ProductType_Code)
And your expression will be =$(vCountProductType)
Thanks.
How can you the single variable can provide different values.
A variable here is calculating the entire total without any distribution of the Product type.
I recommend you to use the expression only.
What you want to achieve , why you want variable?
Hi, thanks voor replying so quickly.
I'm now just trying to understand why the result is different and how I can get the same result when using an variable.
The idea is to make the field that needs to be counted omitted so I only need 1 variable/expression for the count of any field I want to show of let the user choose wicht count to show.
Don't now if this is possible as simple as this but that's what I'm thinking of.
Hi Hugo,
In your variable, remove the = sign at the beginning - what this tells Qlikview is to calculate the value globally, so it will return a total.
If you're storing it as text, when you then reference it in your listbox, include a DSE (dollar sign expansion) to calculate the expression you're storing.
So your variable is Count(Product_ProductType_Code)
And your expression will be =$(vCountProductType)
Thanks.
Variable can not achieve this.
Why you want to omit it?
From where you want it to be omitted ?
Use hide prefix
Set Hide Prefix=$;
Now rename
Product_ProductType_Code as $Product_ProductType_Code
Hi Aaron,
That's exactly what I wanted to now and understand.
Guess I need to get familiar with the syntax and it's differences in result.
Thanks!