Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

using mid() with set analysis?

I'm trying to do something like sum({<mid(FieldName,5,1)={'F'}>} value) but I can't get it to work and the search wildcards don't seem to be as powerful. what do you recommend?

5 Replies
Anonymous
Not applicable
Author

Hi,

As far as I know you're only allowed to use full fields to the left of the equal to signs:

sum({<FieldName={'F'}>} value)

Instead I would suggest extracting the mid(FieldName,5,1) as a new field on the script side and using it like in the example above. It should save you some calculation power compared to wildcard searching as it's only one character that is to be matched.

Not applicable
Author

Hi,

Why do you need set analysis? you can use the sentence:

=

sum(if(mid(FieldName, 5, 1) = 'f', Value))





It works for me.

Best regards.

Not applicable
Author

Hi angain,

if you really need set analysis this is the sentence:

sum( {$< FieldName = {"=mid(FieldName,5,1) = 'f' "} >} Value)

See my attached example file.

Best regards.

Not applicable
Author

Hi Miguel!

I followed this discussion, and I find your's a very interesting solution. Thank you for this suggestion!

But I ask you where can I find a complete "set analysis developer guide", to learn from this kind of syntax: really I'm not be able to understand the result of "=mid(FieldName,5,1) = 'f' ", can you help me?

Thanks a lot (and excuse me for my very little english).

Roberta

Not applicable
Author

Hi Roberta,

first at all, you don't need apologize to me because my english is poor too, my native language is spanish.

Unfortunately, as far as I know, there isn't a "set analysis developer guide", all I know about it, it's the result of fights with a lot of proyects.

I could try explain you the result of "=mid(FieldName,5,1) = 'f' ", hoping it would be usefull for you.

Basicly, what the condition does, is filtering all data (the result include all the fields) and you can compare any field with the result, obviously it depends of what you want, I mean, in this example, I wanna sum all the values by FieldName, imagine, there is another field like city, you could sum the value by only the cities resulting from the condition.

I hope this help you a little bit.

Best regards.