Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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()
Probably this will help
Sum( {<Country -={China,UK}>} Sales)
With E you can try this:
Sum({<Country = e({<Country = {'China', 'UK'}>})>} sales)
or
Sum({<Country *= e({<Country = {'China', 'UK'}>})>} sales)
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
try this please
=sum({<Country=e(1<country={‘china’,’uk’}>})>}sales)
corrected code
try this please
=sum({<country=e({1<country={"china","UK"}>})>}sales)
without e()
=sum({<country={"*"}-{"uk","china"}>}sales)
try this please