Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Error in expression

Try 'not equal to', like:

FirstAgent={'<0>0'}

Or,

FirstAgent -={'0'}

vsudhakar
Contributor III

Re: Error in expression

two aggr functions using not working it get the error

andrespa
Valued Contributor

Re: Error in expression

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

vsudhakar
Contributor III

Re: Error in expression

it taken the only count function

Not applicable

Re: Error in expression

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
Valued Contributor

Re: Error in expression

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

Re: Error in expression

Hi Andres,

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

Thanks

Hasvine

smirkinaa
New Contributor III

Re: Error in expression

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.

Re: Error in expression

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

Community Browser