Qlik Community

Qlik Sense App Development

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

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
jjwild00
New 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

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

Is this what you are after?

Capture.PNG

Calculated dimension:

=SubStringCount(

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

)

5 Replies

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

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

jjwild00
New Contributor III

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

I uploaded a sample.

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

Is this what you are after?

Capture.PNG

Calculated dimension:

=SubStringCount(

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

)

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

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
New Contributor III

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

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

Community Browser