Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set expression

Hi,

I need a set expression which ignores the current selection in the Field 'Media' and excludes the value 'Internet'.

If I try <Media-={'Internet'}>, then it excludes Internet but takes into account all current selections.

How can I set it to ignore the current selection in the Field 'Media'?

Thank you in advance,

Larisa

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

SUM({1<Media-={'Internet'}>}YourFactDataField)or

or

SUM({<Media={'*'}-{'Internet'}>}YourFactDataField)

View solution in original post

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

try with

<Media-={'Internet'}, Media=>,

MK_QSL
MVP
MVP

SUM({1<Media-={'Internet'}>}YourFactDataField)or

or

SUM({<Media={'*'}-{'Internet'}>}YourFactDataField)

jagan
Luminary Alumni
Luminary Alumni

Hi,


Try like this


<Media=P(Media) - {'Internet'}>


Instead arrive a flag in the script for internet and use that flag, it is best approach


LOAD

*,

If(Media='Internet', 1, 0) AS IsMediaInternet

FROM DataSource;


Now use

<IsMediaInternet={0}> for excluding internet


Hope this helps you.


Regards,

Jagan.


er_mohit
Master II
Master II

Try like this

Sum({<Value-={'Internet'},Media=>}Salevalue)

svenkita
Creator II
Creator II

The following expression will exclude the current selection and Internet

Sum({<Media=e(Media)-{'Internet'} >}Sales)

Attached is a sample file

Hope this helps

jonathandienst
Partner - Champion III
Partner - Champion III

If you want to respect all selections except Media, but want to exclude selections in Media, then this will ignore the Media selection:

=Sum({<Media-={'Internet'}>} Sales)

If something else is selected that is limiting Media, then that something else will be restricting the metrics as well, so there is no need usually to take this into account - just let QV handle the associations for you.

However, if there is some reason you need to consider selections except for those in Media, perhaps you need a union or intersection in the set expression, something like these:

Sum({$<Media> * 1<Media-={'Internet'}>} Sales) (intersect - I think this will be the same as above

Sum({$<Media> + 1<Media-={'Internet'}>} Sales)  (union - will include current selections with media ignored, as well as values with Media excluding Internet)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks, everyone!