Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

trouble limiting canonical week Calculated Dimension

I have a chart where the dimension is a set of canonical WeekName()'s (called CanonicalWk)

I only want to show weeks after the minimum date in another non-canonical week field, say ShippedWk.  In other words, I'm lopping off all the empty weeks on the left side of the chart up to the earliest week with Shipping data, then showing all weeks after that.  In the test data, this minimum week happens to be 2014/23.

Another note - I have to display all canonical weeks after this date whether they have 0 values or not, so I can't simply use the Suppress options on the Presentation tab.

I assume that the right way to do this is with a Calculated Dimension.

If I hard code the minimum date into the Calculated Dimension like this, I get exactly what I want:

=if(CanonicalWk>='2014/23',CanonicalWk)

I also know that this yields the string 2014/23.

=MinString({$<status={'X','Y'}>} ShippedWk)

But if I combine those into this Calculated Dimension, I get "Error in calculated dimension"

=if(CanonicalWk>=MinString({$<status={'X','Y'}>} ShippedWk),CanonicalWk)

Is this a syntax issue, or am I missing something bigger?

1 Solution

Accepted Solutions
Not applicable
Author

Ah.  Syntax.  Unless it's an integer, single quotes are needed.  The correct answer is:


=if(CanonicalWk>='$(=MinString({$<status={'X','Y'}>} ShippedWk))',CanonicalWk)

View solution in original post

3 Replies
Gysbert_Wassenaar

Try =if(CanonicalWk>=$(=MinString({$<status={'X','Y'}>} ShippedWk)),CanonicalWk)


talk is cheap, supply exceeds demand
Not applicable
Author

No difference - same error.

I should mention too that there are no errors (red underlining) shown as I populate the Calculated Dimension field.  The chart shows a single bar, and the dimension label beneath the bar is "// Error in calculated dimension"

Capture.PNG

Not applicable
Author

Ah.  Syntax.  Unless it's an integer, single quotes are needed.  The correct answer is:


=if(CanonicalWk>='$(=MinString({$<status={'X','Y'}>} ShippedWk))',CanonicalWk)