Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression Help

HI All

I am currently using this set analysis for calculating Netsales in a Straight Table

SUM(

  AGGR(

  (

  Sum({<MONTH={'$(vThismonth)'},CR -={1}>}NETSALE))

now i need to exclude 75% of credits, with flag 1

exclude CR = 1

how to achieve this

i tried this but result not as expected its generating all values as 0

SUM(

  AGGR(

  (

  Sum({<MONTH={'$(vThismonth), 0.75 * CR -={1}'}>}NETSALE))


Please Suggest

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

SUM(

AGGR(

(Sum({<MONTH={'$(vThismonth)'}>}NETSALE) - (Sum({<MONTH={'$(vThismonth)'}, CR={1}>}NETSALE) * 0.75))

/ Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS)

, BRANCH))

View solution in original post

9 Replies
morganaaron
Specialist
Specialist

Exclude 75% of credits? Are those defined or do you just mean 75% of the value? If so, just calculate the NETSALE value for the credits separately, multiply that by 0.75 and subtract it from your initial expression..

vishsaggi
Champion III
Champion III

Hello John,

Could you share a sample file and expected output so that we can work on it easily.

Thanks,
V.

Not applicable
Author

HI Aaron

here is the small data sample, please suggest how can achieve this in the script level only with CR = 1

morganaaron
Specialist
Specialist

I don't know what dimensions your table is holding, as you don't seem to have included the field you're aggregating over in your first post, but the theory behind the actual sum (ignoring aggr for now) is just saying:

Sum({<MONTH={'$(vThismonth)'}>}NETSALE)) - (Sum({<MONTH={'$(vThismonth)'}, CR={1}>}NETSALE)) * 0.75)

Unless I've misunderstood you?

HirisH_V7
Master
Master

Hi ,

For example we can use like this,

=Sum({<CR={0}>}NETSALE)

=Sum({<CR={1}>}NETSALE)


=Sum({<CR-={0}>}NETSALE)

=Sum({<CR-={1}>}NETSALE)

But exactly explain whats your expression . By based on requirement we can use Precedes and Follows also.

Thanks,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable
Author

HI Aaron

actually this is the complete Expression

SUM(

  AGGR(

  (

  Sum({<MONTH={'$(vThismonth)'}, CR -={1}>}NETSALE)

  /

  Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS)

  )

  ,BRANCH)


Kushal_Chawda

try this

(SUM(AGGR((Sum({<MONTH={'$(vThismonth)'}, CC -={1}>}NETSALE)

/Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS) ) ,BRANCH))

-

(SUM(AGGR((Sum({<MONTH={'$(vThismonth)'}, CC -={1}>}NETSALE)

/Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS) ) ,BRANCH)*0.75)

morganaaron
Specialist
Specialist

SUM(

AGGR(

(Sum({<MONTH={'$(vThismonth)'}>}NETSALE) - (Sum({<MONTH={'$(vThismonth)'}, CR={1}>}NETSALE) * 0.75))

/ Only({<MONTH={'$(vThismonth)'}>}WORKINGDAYS)

, BRANCH))

Not applicable
Author

Thanks Aaron

Thank You All