Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've seen various posts on this but cannot get the below set analysis to ignore selections while respecting the set analysis criteria. Any thoughts? When I select a filter, the result changes contrary to what I expected.
sum( {1 <TranYr = {$(PreviousYear)},
Month_Paid_Adj ={"<=$(=CurrMonth)"}>}
if(placedt_all=aggr({1} nodistinct max(placedt_all),acctpol), -Payment))
FYI - below is the solution I came up with. I exchanged one of the fields, Previous Year, to be a field instead of a variable. I also made sure to put {1} in the appropriate places of the AGGR formula. Between both these changes, or maybe just the latter change, my selections seem to be ignored as I want them to be.
sum( {1 <TranYr = {$(=PrevYr)},[Transaction Month],[Transaction Year],
Month_Paid_Adj ={"<=$(=CurrMonth)"}
,placedt_all={"=max({1} aggr(
nodistinct max({1} placedt_all),acctpol))"}
>} -Payment)
you actually have two expressions here, one is a sum another is a max. you need to make sure that the set analysis in sum is not applicable to the max expression. that will depend on your data model.
Notes below
sum( {1 <TranYr = {$(PreviousYear)}, <<if the variable PreviousYear / CurrMonth is changing when making selections then you also need to ignore selection it the variable definition
Month_Paid_Adj ={"<=$(=CurrMonth)"}>}
if(placedt_all=aggr({1} nodistinct max(placedt_all),acctpol), -Payment)) <<--here max() is not ignoring selections
also is if(placedt_all= will also respond to all selections
Can you post some sample data what exactly are you trying to calculate
I'm not sure what you mean by that, but what I did find is the IF statement in the original syntax above is causing the issue. I then tried to recast the IF statement as an extra set analysis expression. This causes the result to be lower than expected. Unfortunately, I cannot post sample data as it is sensitive. Any thoughts on how to reconfigure the below? The purpose of the last part of the set analysis expression starting with placed_all is to select the most recent placedt_all by acctpol.
sum( {1 <TranYr = {$(PreviousYear)},
Month_Paid_Adj ={"<=$(=CurrMonth)"},
placedt_all={"=aggr({1} nodistinct max(placedt_all),acctpol)"}>} -Payment)
FYI - below is the solution I came up with. I exchanged one of the fields, Previous Year, to be a field instead of a variable. I also made sure to put {1} in the appropriate places of the AGGR formula. Between both these changes, or maybe just the latter change, my selections seem to be ignored as I want them to be.
sum( {1 <TranYr = {$(=PrevYr)},[Transaction Month],[Transaction Year],
Month_Paid_Adj ={"<=$(=CurrMonth)"}
,placedt_all={"=max({1} aggr(
nodistinct max({1} placedt_all),acctpol))"}
>} -Payment)