Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum() with many filter with which function?

Hi,

I've many IDs with Amount like:

ID, Amount

400000, 4500

...,...

999999,4000

Now I need to sum() all the ID from: 400000 - 59999 AND 677000  AND 688000, except 494500, 494700,494800


How can I express this?

Do you have an idea ?

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try this and let me know

Sum({$ <ID={'>=400000<=59999', '>=677000<=688000'}-{'494500','494700','494800'}>} Amount)

Not applicable
Author

sum($ <ID={'>=400000<=599999','677000','688000'}-{'494500','494700','494800'}>} Amount)

-> I get a crash of the project..

alexandros17
Partner - Champion III
Partner - Champion III

could you sent it to me?

Not applicable
Author

u cant test it, because the database is local ..

tresesco
MVP
MVP

Set analysis can't be used in the script. You should try the expression in the front end.

MayilVahanan

Hi

Script:

ODBC CONNECT TO Navision;

TT:

Load *;

SQL SELECT Amount,

    "Global Dimension 1 Code",

    "Global Dimension 2 Code",

    "Posting Date",

    "G_L Account No_"

FROM "DBase".dbo."DB9";

Front view:

Create a chart by using "Global Dimension 1 Code" as dimension

Expression:

sum({$ <"Global Dimension 1 Code"={'>=400000<=599999','677000','688000'}-{'494500','494700','494800'}>} Amount)

or

Load * where not match ("Global Dimension 1 Code", '494500','494700','494800);

SQL SELECT Amount,

    "Global Dimension 1 Code",

    "Global Dimension 2 Code",

    "Posting Date",

    "G_L Account No_"

FROM "DBase".dbo."DB9";

Front view:

Create a chart by using "Global Dimension 1 Code" as dimension

Expression:

sum(Amount)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

How could the expression looks like?

Is it possible to sum() alle the values that I need, and at least subtract the sum() of the values that I want to except ?

like:

sum(amount) as sum1

sum(amount) as sum2

sum(amount) as subtractiom1

(sum1+sum2) -subtraction1

How can this be solved ?

Not applicable
Author

You can do the same at the back end and front end.