Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I want to exclude the type "gaming" from "laptop" in the total sum of the products, so I put this expression in the sum
"sum({<Type-={"Gaming"}>}TOT_COUNT)". As a result, keyboard and Screen values are omitted, too while I excluded only Gaming type.
The only solution that came to my mind is to add the Type to table Keyboard and Screen in the code below. but it'll take so much time to reload. I hope there is a better solution for this.
Laptop:
LOAD * INLINE [
product, Type, TOT_COUNT
Laptop,Gaming ,10,
Laptop,Macbook ,10 ,
Laptop,Ultrabook ,10 ,;]
NoConcatenate
Screen:
LOAD * INLINE [
product, TOT_COUNT
Screen, 20, ];
NoConcatenate
Mouse:
LOAD * INLINE [
product, Type, TOT_COUNT
Mouse,Wired , 10 ,
Mouse,Wireless ,10 , ];
NoConcatenate
keyboard:
LOAD * INLINE [
product, TOT_COUNT
keyboard, 10,];
NoConcatenate
Tab:
Load * Resident Laptop;
drop table Laptop;
Concatenate(Tab)
Load * Resident Screen;
drop table Screen;
Concatenate(Tab)
Load * Resident Mouse;
drop table Mouse;
Concatenate(Tab)
Load * Resident keyboard;
drop table keyboard;
Hi, Maybe this?
=Sum( {$<Type-={'Gaming'}> +<Product = E({<Type={"*"}>})>} TOT_COUNT)
Have you tried something along the lines of:
sum({$ - <Type={"Gaming"}>}TOT_COUNT)
Hi, Maybe this?
=Sum( {$<Type-={'Gaming'}> +<Product = E({<Type={"*"}>})>} TOT_COUNT)
Have you tried something along the lines of:
sum({$ - <Type={"Gaming"}>}TOT_COUNT)
No it didn't work. thank you for the effort
Thank you it woeked. So if i want to exclude the sales of screens it will be like this
sum({$ - <Type={"Gaming"}> - <product={"Screen"}>}TOT_COUNT)
It works perfectly for me though.
If the product field is always populated (no nulls), you could use a slightly cleaner version:
sum({<product-={"Screen"}> - <Type={"Gaming"}> }
Thanks for the solution. But it give me a wrong result a right result when I select a product, As it is shown in the example below