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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dadumas
Creator II
Creator II

Cycle group dimension in Sense

I read a great article to achieve a cycle dimension in Sense, but cannot get it to work.  Fails when referencing the calculated dimension expression in a chart.

I have an inline table in my model:

AdHocDimensions:

Dim,DimSort

Region,1

Sales Person,2

etc...

works great, tests fine

I then create 2 variables:

vMinDimSort, defined as:  min(DimSort)   This displays fine

vDim, defined as : minstring({<DimSort={"$(=$(vMinDimSort))"}>} Dim)    thiis works, but only when defined using a search string with the double quotes syntax.

The article says to code vDim simply as : minstring({<DimSort={$(vMinDimSort)}>} Dim)    but his gives a "set modifier error"  .  I have even put single quotes around $(vMinDimSort), but same error.

When I define vDim without the error, I can display $(vDim) as a measure in a textbox, so that that works fine, Example:  Region displays as expected in a textbox.

Then in my chart, I use =[$(vDim)] as a calculated dimension

Does not work, gives a set analysis error.  I would expect that if the textbox works with this variable, then the dimension reference with that same variable should work.

Any ideas?

Dave

 

 

 

Labels (1)
1 Solution

Accepted Solutions
dadumas
Creator II
Creator II
Author

I got this to work.  You have to reference the dimension expression in the chart as :  =[$(=$(vDim))]

So, in summary, to create a cycle group dimension in qlik sense:

vDim should be defined as :    minstring({<DimSort={"$(=$(vMinDimSort))"}>} DimName)

The label for the dimension should be defined as:   ='$(=$(vDim))'

5 hours to figure this out 😞

 

 

 

View solution in original post

3 Replies
dadumas
Creator II
Creator II
Author

I have simplified the variable vDim, used for the dimension to be defined simply as:   only(DimName)

I am seeing that when using this as the expression for a dimension dimension in a chart,  =[$(vDim)]  gives an error in the expression editor of :  "Error in Expression"  =[only(DimName)]

So, in summary it does not appear to work to base a dimension on an expression that is based on text strings sourced from an inline table  where the source strings match the dimension names.  I have no clue how anyone got the example used in the article to actually work.

Dave

dadumas
Creator II
Creator II
Author

I got this to work.  You have to reference the dimension expression in the chart as :  =[$(=$(vDim))]

So, in summary, to create a cycle group dimension in qlik sense:

vDim should be defined as :    minstring({<DimSort={"$(=$(vMinDimSort))"}>} DimName)

The label for the dimension should be defined as:   ='$(=$(vDim))'

5 hours to figure this out 😞

 

 

 

dadumas
Creator II
Creator II
Author

vDim is now defined correctly as:  

minstring({<DimSort={"$(=$(vMinDimSort))"}>} DimName)

And this is how you have to reference the label of the Dimension:  ='$(=$(vDim))'

Dave