Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pavansonu99
Creator
Creator

reg: E() in set analysis

hi,

My data is like this

country          sales

india               1000

china              1400

usa                 1600

uk                   1300

germany          1900

i want sum of sales of countries but i want to exclude countries 'china' and 'UK'

how can we write set analysis in the expression          using E() and without using E()   

7 Replies
rupamjyotidas
Specialist
Specialist

Probably this will help

Sum( {<Country -={China,UK}>} Sales)

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

Have you read this document?

https://community.qlik.com/docs/DOC-4951

Best regards,

D.A. MB

sunny_talwar

With E you can try this:

Sum({<Country = e({<Country = {'China', 'UK'}>})>} sales)

or

Sum({<Country *= e({<Country = {'China', 'UK'}>})>} sales)

miguelbraga
Partner - Specialist III
Partner - Specialist III

You can also try this out:

Expressions:

Without E():

Sum( {$<country -= {"china","uk"}>} sales)

With E():

Sum({$<country = e({<country = {"china", "uk"}>})>} sales)

Script:

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='£#,##0.00;-£#,##0.00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

LOAD * INLINE [

    country, sales  

    india, 1000

    china, 1400   

    usa, 1600   

    uk, 1300

    germany, 1900

];

Check my solution in the attached qvw file

Best regards,

D.A. MB

Not applicable

try this please

=sum({<Country=e(1<country={‘china’,’uk’}>})>}sales)

Not applicable

corrected code

try this please

=sum({<country=e({1<country={"china","UK"}>})>}sales)

Not applicable

without e()

=sum({<country={"*"}-{"uk","china"}>}sales)

try this please