14 Replies Latest reply: Mar 6, 2017 7:26 AM by Anna fuksa

# If into setAnalysis

Expression-

SUM(IF((TranTyp = 'CO' OR TranTyp = 'CB' OR TranTyp = 'DR' OR TranTyp = 'RC' OR TranTyp = 'BP' OR TranTyp = 'TR' )

AND TranDt>=\$(vFromDate), TranAmt))/1000000

Can anybody help me convert in to setanalysis

Guidence is Appreciated..

• ###### Re: If into setAnalysis

Sum(

{<

TranTyp = {'CO','CB','DR','RC','BP','TR'},

TranDt={">=\$(vFromDate)"}

>}

TranAmt)/1000000

• ###### Re: If into setAnalysis

Thanks Shubham Singh ,

when i pasted this in expression editor, it is showing

"THE SELECTIONS GENERATED NO DATA FOR THIS CHART "

why is like this , any further investigation ppleasee

Help is appreciated

• ###### Re: If into setAnalysis

Try adding an equal sign just before expression of variable vFromDate.

If that doesn't work share your vfromdate expression or a sample app.

• ###### Re: If into setAnalysis

SUM(if(TranTyp='CB' AND TranDt>=\$(vFromDate), TranAmt))/

SUM(AGGR(if(DemandDate>=\$(vFromDate) and DemandDate<=Today

AND DemandDate >= MonthStart(min(TranDt)) and DemandDate <= MonthEnd(max(TranDt)), SUM(DemandAmt)),DemandDate))

can u convert this in to setanalysis shubum please..

• ###### Re: If into setAnalysis

SUM ( {<TranTyp='CB',TranDt={'>=\$(=Date(vFromDate,'MM/DD/YYYY'))'} >}TranAmt)

/

Aggr(Sum({\$<TranDt={'>=\$(=Date(vFromDate,'MM/DD/YYYY')))<=\$(=Date(Today,'MM/DD/YYYY')))'}>},

{\$<DemandDate={'>=\$(=Date(Monthstart(Min(TranDt)),'MM/DD/YYYY'))<=\$(=Date(MonthEnd(Max(TranDt)),'MM/DD/YYYY'))'}>}      DemandDate ), DemandDate )

• ###### Re: If into setAnalysis

SUM({<TranTyp = {'CO' , 'CB' ,'DR' , 'RC','BP','TR' }, TranDt ={">=\$(vFromDate)"}>} TranAmt)/1000000

• ###### Re: If into setAnalysis

How did you declare vFromDate?

• ###### Re: If into setAnalysis

DATE(IF(vFrequency = 'Y',DateCurrYearStart,

IF(vFrequency = 'Q',QuarterStart(TodayNum),

IF(vFrequency = 'M',MonthStart(TodayNum),

IF(vFrequency = 'D', Today)))))

• ###### Re: If into setAnalysis

Above is the vFromDate

• ###### Re: If into setAnalysis

Need a couple more single quotes for vFromDate:

=Sum(

{<

TranTyp = {'CO','CB','DR','RC','BP','TR'},

TranDt={">='\$(vFromDate)'"}

>}

TranAmt)/1000000

• ###### Re: If into setAnalysis

Or change vFromDate to a number (replace the Date() statement):

Num(IF(vFrequency = 'Y',DateCurrYearStart,

IF(vFrequency = 'Q',QuarterStart(TodayNum),

IF(vFrequency = 'M',MonthStart(TodayNum),

IF(vFrequency = 'D', Today)))))

• ###### Re: If into setAnalysis

Try

=DATE(IF(vFrequency = 'Y',DateCurrYearStart,

IF(vFrequency = 'Q',QuarterStart(TodayNum),

IF(vFrequency = 'M',MonthStart(TodayNum),

IF(vFrequency = 'D', Today)))))

Also check format of TranDt i.e whether it is Number format or Date, if in Date what is exact format

• ###### Re: If into setAnalysis

Try it,

IF((TranTyp = 'CO' OR TranTyp = 'CB' OR TranTyp = 'DR' OR TranTyp = 'RC' OR TranTyp = 'BP' OR TranTyp = 'TR' )

AND TranDt>=\$(vFromDate), Sum(TranAmt)/1000000)

• ###### Re: If into setAnalysis

if any of the propositions is not working can you post your app ?

If is working can you mark it as answered ?

Anna