Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in expression

Hello All,

Could you please help me to get the expression below to work:

=-(1-(sum(total<Friendly_Name,FirstName,LastName>AGGR(

        ( COUNT( {<FirstAgent={'<>0'}>}ID) / COUNT( TOTAL {<FirstAgent={'<>0'}>}ID) )

     , FirstName,LastName,Friendly_Name)* TMTcible/Count({<FirstAgent={'<>0'}>}ID))))

Thanks,

Hasvine

9 Replies
tresesco
MVP
MVP

Try 'not equal to', like:

FirstAgent={'<0>0'}

Or,

FirstAgent -={'0'}

Anonymous
Not applicable
Author

two aggr functions using not working it get the error

andrespa
Specialist
Specialist

Hi Hasvine:

=-(1-(sum(total<Friendly_Name,FirstName,LastName>AGGR(

        ( COUNT( {<FirstAgent-={0}>}ID) / COUNT( TOTAL {<FirstAgent-={0}>}ID) )

    , FirstName,LastName,Friendly_Name)* TMTcible/Count({<FirstAgent-={0}>}ID))))

Hope it helps,

Andrés

Anonymous
Not applicable
Author

it taken the only count function

Not applicable
Author

Hello All,

Thank you for your help. the set analysis part is good i believe that the issue lies either with the aggr or with the brackets which are wrongly position as I checked each set individually and it works fine.

Thanks,

Hasvine

andrespa
Specialist
Specialist

Hi Hasvine, at first glance I can't tell you more without any sample data. Could you share some to let what's going on?

Cheers,

Andrés

Not applicable
Author

Hi Andres,

I will send you a sample soon. I am preparing it.

Thanks

Hasvine

smirkinaa
Contributor III
Contributor III

Hi. Your mistake is in using function 'Count' like argument of function 'Sum' with in combination with function 'Aggr':

=-(1-(sum(total<Friendly_Name,FirstName,LastName>AGGR(

        ( COUNT( {<FirstAgent={'<>0'}>}ID) / COUNT( TOTAL {<FirstAgent={'<>0'}>}ID) )

    , FirstName,LastName,Friendly_Name)* TMTcible/Count({<FirstAgent={'<>0'}>}ID))))

if we remove expression 'Count({<FirstAgent={'<>0'}>}ID)' formula works.

sunny_talwar

May be this:

=-(1

-(Sum(TOTAL<Friendly_Name,FirstName,LastName>

  Aggr(

        (

          Count({<FirstAgent={'<>0'}>}ID)/Count(TOTAL {<FirstAgent={'<>0'}>}ID)

          ),

  FirstName,LastName,Friendly_Name))

*

TMTcible)

/

Count({<FirstAgent={'<>0'}>}ID))

or this:

=-(1

-(Sum(TOTAL<Friendly_Name,FirstName,LastName>

  Aggr(

        (

          Count({<FirstAgent={'<>0'}>}ID)/Count(TOTAL {<FirstAgent={'<>0'}>}ID)

          ),

  FirstName,LastName,Friendly_Name))

*

TMTcible

/

Count({<FirstAgent={'<>0'}>}ID)))