Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Re: A Primer on Set Analysis Blog Post

Yes, I know it has a lot of functionality (altern states, bookmarks, the "1-$", E(), modifier operators...), what I tried to say is:

If you have something working with an 'if' solution, sometimes you look for a 'set analysis' solution because of performance.

I take this ocassion to thank you for all the very good posts on design blog.

robert99
Valued Contributor II

Re: A Primer on Set Analysis Blog Post

No I have tried to convert all of my 'IF' expressions to set analysis

But with some of the more complex ones (using > etc. I didn't because I could not get them to work. Whereas 'IF'  worked as required

BUT one thing I did not like with set analysis (as opposed to if) is the lack of a drill down feature

Example

Sum( {$<Date =  {Max(Date)}>} Sales)

If I wanted to filter (make  a selection) of Date = 10/01/2015. It wouldn't work because date is already set to Max(Date)

But if

Sum( {$<Date *=  {Max(Date)}>} Sales)

is used it seems to overcome this issue

I have only used this in a few examples recently (once I found out about  *=) but am unsure if I should be using it in this way.

Hope this makes sense

Partner
Partner

Re: A Primer on Set Analysis Blog Post

Hi Henric,

great post, as usual.

Did i well understand ? Simple quotes should never be used with set analysis.

If i want to make a simple filter on a text field, i must write :

Sum( {$<Country="France">} Sales) and not Sum( {$<Country='France'>} Sales), correct ?

as you wrote

Single quotes should denote literals, i.e. explicit field values.

i'm a bit confused.

Best regards,

Johann

Re: A Primer on Set Analysis Blog Post

In your case, both will probably work. The single quotes should be a case-sensitive match and the double should be a case-insensitive search.

But as soon as you insert wild cards it will matter.

Consider the following: {$<Country={"Fr*"}>} vs {$<Country={'Fr*'}>}. Here the "Fr*" means a search and the * is a wild card. But since single quotes is a literal, 'Fr*' will match the exact combination of 'Fr*', i.e. three characters where the last is an asterisk.

HIC

mov
Esteemed Contributor III

Re: A Primer on Set Analysis Blog Post

Hi Johann,

I"m not Henric but can answer this one...

'France' is a filed value, hence it must be in the single quotes.  You second example is almost correct.  It should be:


Sum({$<Country={'France'}>} Sales)

Regards,

Michael

Partner
Partner

Re: A Primer on Set Analysis Blog Post

ok, thank you very much for your answer !

so is there any performance boost to use single quotes when you actually want to use literals ? ie.

Sum{<MyField={'<field value here'}>} value)

instead of

Sum{<MyField={"<field value here"}>} value)

best regards.

Johann

Partner
Partner

Re: A Primer on Set Analysis Blog Post

Thanks michael !

Highlighted
robert99
Valued Contributor II

Re: A Primer on Set Analysis Blog Post

As an example

This gives the correct result

Count

({< FSRNum2 = {1},CalTStdPM = {STD} ,Group = {Calls} >}
distinct (if ( ((Call_RDate)) >= ( VisMinStartRef)
,CallSerial)))

But this doesn't


Count     ({$< FSRNum2 = {1},CalTStdPM = {STD} ,Group = {Calls},
Call_RDate = {" >= VisMinStartRef " }>}     distinct CallSerial)

I can not work out why?