Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Calculation problems - Confused

I’m really confused.  I have 3 dims (Year, Plant and Material) and this works  sum({<[Count_Date_Num] = {$(=max([Count_Date_Num]))}>} [Value book qty_WRTBM]).  Now I want to take out material and only have 2 dims (Year and Plant) and it does not work.  Any ideas?

Thanks
Thom

17 Replies
Not applicable

What happens when you create another object with only the expression and then add in the dimensions?

Not applicable

I tested your expression with some dummy data. Everything seems to work and I can remove the dimensions. Could your object just be corrupted somehow?

tmumaw
Specialist II
Specialist II
Author

Could you try multiple plants thanks

Not applicable

Like this? I am guessing at the structure of your data, obviously. Did you retry creating the object?

tmumaw
Specialist II
Specialist II
Author

Yes and I get the same results.  When I select a year and plant the correct dollar values shows up, however when I select all years and all plants everything goes to 0 dollars.  Really confused.

Anonymous
Not applicable

Hard to say with this little information, but I'm guessing the dollar-sign expansion evaluates to NULL when things go wrong. These expressions can be debugged using the technique decribed here: http://community.qlik.com/message/175219#175219

Message was edited by: lf_fk_bkk

tmumaw
Specialist II
Specialist II
Author

So what it looks like it's doing is setting the Max date based on all the dates in the QVW, not based on the dimensions I have selected.  How can I make it based on dimensions?  Any ideas.  Thank for the debugging link it helped.

Anonymous
Not applicable

This might not work, but you could try to explicitly set the values which are not being set in your dollar sign expansion by using the "Posible values" function P. However, this means you have set analysis within set analysis, so --- generally speaking --- when things get this ugly there may well be a different, better solution to your problem, such as computing the required max during load time and creating a new field, or something similar. Once again, hard to say something concrete without looking at the actual application.

Not applicable

The behavior I have seen from $ expansion is that it does take into account the selections made on dimensional data. That being said, can you scramble your data in the QVW and attach it to this thread for review?