6 Replies Latest reply: Apr 4, 2016 8:14 AM by Kaushik Solanki

if condition with Aggregation Expression

Hi All..

I Want to create funnel chart ... so i have a Inline Table Say,

FunnelView:

[

"KPI Funnel", FunnelViewDimOrder

"Spend", 1,

"Sessions", 2,

];

And in funnel chart .. I have a Dimension [KPI Funnel]

And Expression :

if([KPI Funnel]='Spend',Sum(Spends),if([KPI Funnel]='Sessions',Sum(Aggr(Visits,VisitFull))   )))...

Leads and Spend giving  a Output but Session is Showing 0 ... for Session exp : Sum(Aggr(Visits,VisitFull)) is

Correct because i am getting a proper value without if condition in other chart .. i tried Writing like this as well

:Sum(if([KPI Funnel]='Sessions',(Aggr(Visits,VisitFull)))) ... its giving value but not correct value kindly help me for the same...

• Re: if condition with Aggregation Expression

>>Sum(Aggr(Visits,VisitFull)) is Correct because i am getting a proper value without if condition in other chart

Your expression looks OK - Sum(If()) is not correct in this context.

What are the dimensions on the table where this expression works?

Why an Aggr()?

• Re: if condition with Aggregation Expression

Also, I would load the dimension like this:

FunnelView:

Load Dual(Text, Order) as "KPI Funnel"

Inline

[

Text, Order

Spend, 1,

Sessions, 2,

];

And then used this rather than a nested if:

=Pick("KPI Funnel",

Sum(Spends),

Sum(Visits),               // why do you nee an Aggr??

)

• Re: if condition with Aggregation Expression

Hi Jonathan ,

I have a two table from where i am getting an value .. without Aggr i am not getting an proper value..

so i have to use the same.. cant we use aggr in if else...

• Re: if condition with Aggregation Expression

Hi,

Aggr expression gives correct output on all dimension say , Date Channel and rest

• Re: if condition with Aggregation Expression

Hi can anyone please update me on my query

• Re: if condition with Aggregation Expression

Hi,

You can try this.

Sum(Aggr(Sum(Visits),VisitFull))

Regards,

Kaushik Solanki