Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
richard_pearce6
Luminary Alumni
Luminary Alumni

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
Author

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

ashfaq_haseeb

Hi your expression



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


Does the same

Regards

ASHFAQ

Not applicable
Author

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
Specialist III
Specialist III

hi,

write like

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

ashfaq_haseeb

HI,

It must work fine it should not return zero.

Can you share a sample app.

Regards

ASHFAQ

richard_pearce6
Luminary Alumni
Luminary Alumni

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

mahesh_agrawal
Creator
Creator

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
Author

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

richard_pearce6
Luminary Alumni
Luminary Alumni

No problem Tom. Pleased you got it sorted!


Richard