Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Set Analysis

Hi,

I have a set analysis statement that produces a ratio/percentage, something like this:

=(Sum ( {$<flag={'FALSE'}>} counted))/(Sum ( {$<flag=>} counted))

I want this value to be unaffected by users making a selection on the 'flag' value (for use with other charts) - I can replace the $ with 1 to ignore selections, but that ignores all selections.  I want the value to be affected by other selections the user chooses.

So, I want it to take into account the 'flag' values set in the statement, but then ignore any user selections on that 'flag' field.

Can this be done, or is there a better way of structuring things?

Thanks

Tags (2)
1 Solution

Accepted Solutions
Luminary
Luminary

Re: Set Analysis

Hi Tom,

It maybe worth sharing a sample app and checking on a small set of data.

{$<flag={'FALSE'}>} Will select in field flag = FALSE regardless of the users selection.

{$<flag=>} Will effectively remove any selections that may be present within the 'flag' field.

Did you check your spelling, capitilisation and spaces in field? Maybe its 'False' or 'false'. Maybe there's a trailing space 'FALSE '. In this type of set analysis you need to be exact.

Regards

Richard

View solution in original post

9 Replies
Not applicable

Re: Set Analysis

can you make your requirements more precise. Its difficult to understand. If you share any example it will be easy to help

Re: Set Analysis

Hi your expression



=(Sum ( {$<flag={'FALSE'}>} counted))/(Sum ( {$<flag=>} counted))


Does the same

Regards

ASHFAQ

Not applicable

Re: Set Analysis

If I create a selection box of the 'flag' field, which has the values TRUE and FALSE, and select TRUE, I get nulls for all values, as this:

=(Sum ( {$<flag={'FALSE'}>} counted))/(Sum ( {$<flag=>} counted))

effectively turns to this:

=0/(Sum ( {$<flag=>} counted)


I want to maintain the result generated with the set analysis statement regardless of the 'flag' user selection.

sasikanth
Valued Contributor III

Re: Set Analysis

hi,

write like

if(getSelectedCount(Flag)>0,(Sum ( {1<flag={'FALSE'}>} counted))/(Sum ( {1<flag=>} counted)),=(Sum ( {$<flag={'FALSE'}>} counted))/(Sum ( {$<flag=>} counted))

Re: Set Analysis

HI,

It must work fine it should not return zero.

Can you share a sample app.

Regards

ASHFAQ

Luminary
Luminary

Re: Set Analysis

Hi Tom,

It maybe worth sharing a sample app and checking on a small set of data.

{$<flag={'FALSE'}>} Will select in field flag = FALSE regardless of the users selection.

{$<flag=>} Will effectively remove any selections that may be present within the 'flag' field.

Did you check your spelling, capitilisation and spaces in field? Maybe its 'False' or 'false'. Maybe there's a trailing space 'FALSE '. In this type of set analysis you need to be exact.

Regards

Richard

View solution in original post

Highlighted
mahesh_agrawal
Contributor

Re: Set Analysis

Hi,

Declare a variable in Variable Overview with "Sum ( {$<flag={'FALSE'}>} counted)".

Remember to add a '=' before the expression in the variable Overview window as it makes the expression global and independent of current selection.

Not applicable

Re: Set Analysis

Hi Richard,

Sorted - yes that was the case, a mistake on my part.  Some very helpful info from everyone else though.

Thanks a lot

Tom

Luminary
Luminary

Re: Set Analysis

No problem Tom. Pleased you got it sorted!


Richard