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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
neil-devlin
Contributor III
Contributor III

Invalid Dimension When Using An Expression

Hi,

I have an issue when I try to use a claculation to display a dimension. I have a table with a list of products and and count measure of the amount of task id's associated with the product. This works fine, however I want to display a table of products where the count = 0. To do this I used the expression IF(COUNT(Task_ID) = 0,Product_Code).

To me this has always worked when using calculated dimensions, what am I doing wrong here?

Labels (1)
3 Replies
SunilChauhan
Champion II
Champion II

We cannot use aggregate function in dimension,its meant for Measure. however you want to use in dimension then

 

use aggr function
IF(aggr(COUNT(Task_ID),field1,field2,..) = 0,Product_Code).

 

where field 1 field 2 are field by which you want to aggr.

without aggr it will not work

Sunil Chauhan
Anil_Babu_Samineni

I don't prefer to use as Calculated dimension because it degrades the performance of the object. instead, can't you do that in measure? 

Best Anil, 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
Amit_Prajapati
Creator
Creator

Hi @neil-devlin , as @Anil_Babu_Samineni  mentioned, We prefer not to use calculated dimensions since they can slow down performance. Instead, can you try doing this in a measure?

You can use a normal dimension along with a measure like COUNT(Task_ID) = 0 to filter and show only the products where Task_ID is 0.

Alternatively, you could also use a Master Dimension or Master Measure for this.