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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jjwild00
Partner - Contributor III
Partner - Contributor III

Really want this to work - substringcount() and aggr()

aggr(concat(SelectedValue1), GroupValue1) returns a single value as GroupValue1 is the same for all records.  The value is 'ABC'.

Value1 is a field that can be A, B, C or D.

The following calculated dimension fails to return a value:

=SubStringCount(aggr(concat(SelectedValue1), GroupValue1), Value1)

However, the following both return the correct value, 1 in the first case and 0 or 1 in the second case:

=SubStringCount(aggr(concat(SelectedValue1), GroupValue1), 'A')

=SubStringCount('ABC', Value1)

I can put part of the expression that fails to return a value into a variable and it works in QlikView.  However, I need to have this work in Sense and its variable handling is not as powerful.

Does anyone see something I can change to get the full expression to work?

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Is this what you are after?

Capture.PNG

Calculated dimension:

=SubStringCount(

Aggr(NODISTINCT Concat(SelectedCallGroup), GroupCallGroup), CallGroup

)

View solution in original post

5 Replies
sunny_talwar
MVP
MVP

Not sure how you are using this, can you share a sample?

jjwild00
Partner - Contributor III
Partner - Contributor III
Author

I uploaded a sample.

sunny_talwar
MVP
MVP

Is this what you are after?

Capture.PNG

Calculated dimension:

=SubStringCount(

Aggr(NODISTINCT Concat(SelectedCallGroup), GroupCallGroup), CallGroup

)

sunny_talwar
MVP
MVP

Also not sure why you need to use this as a dimension, but usually to show selection from an unlinked field, we can use set analysis like this

Sum({<CallGroup = p(SelectedCallGroup)>}1)


Capture.PNG

jjwild00
Partner - Contributor III
Partner - Contributor III
Author

Thanks for this too.  It is a dimension so I can set it to not show on the chart if it is null.  If the SubStringCount returns 0, then I do not want the row in the chart.

This is not possible in a measure (Sense term for an expression).