Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
brijeshvma
Partner - Creator
Partner - Creator

if condition with Aggregation Expression

Hi All..

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

FunnelView:

Load * Inline

[

"KPI Funnel", FunnelViewDimOrder

"Spend", 1,

"Sessions", 2,

"Leads", 3,

];

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

And Expression :

if([KPI Funnel]='Leads', Count(distinct LeadID),

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...

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

>>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()?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Also, I would load the dimension like this:

FunnelView:

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

Inline

[

Text, Order

Spend, 1,

Sessions, 2,

Leads, 3,

];

And then used this rather than a nested if:

=Pick("KPI Funnel",

     Sum(Spends),

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

     Count(distinct LeadID)

)


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
brijeshvma
Partner - Creator
Partner - Creator
Author

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...

brijeshvma
Partner - Creator
Partner - Creator
Author

Hi,

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

brijeshvma
Partner - Creator
Partner - Creator
Author

Hi can anyone please update me on my query

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can try this.


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


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!