Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

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
Highlighted

Is this what you are after?

Capture.PNG

Calculated dimension:

=SubStringCount(

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

)

View solution in original post

5 Replies
Highlighted

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

Highlighted
Partner
Partner

I uploaded a sample.

Highlighted

Is this what you are after?

Capture.PNG

Calculated dimension:

=SubStringCount(

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

)

View solution in original post

Highlighted

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

Highlighted
Partner
Partner

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).