Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
effinty2112
Honored Contributor

Re: Scripting Issue

Hi Ben,

               It's an expression in a straight table. In fact in the second table you can simplify the expression a little and take out the NODISTINCT clause when you have the single dimension of Case.

Cheers

Andrew

effinty2112
Honored Contributor

Re: Scripting Issue

Hi Ben,

               It a bit awkward to copy and paste the expression from the table so here it is:

if(Sum(Aggr(NODISTINCT Count({$<[American Entity] = {'Y'}>}Entity),Case))>0,'Y','N')

or

if(Sum(Aggr(Count({$<[American Entity] = {'Y'}>}Entity),Case))>0,'Y','N')


for the single dimension table where the NODISTINCT clause is not necessary.


cheers


Andrew

Not applicable

Re: Scripting Issue

Hi Andrew,

Thanks, is there a way to do a count of this?

I.e. count all of the cases that are American (have a Y).

richard_chilvers
Contributor III

Re: Scripting Issue

Hi

I had a similar challenge and I think I would LOAD MaxString([American Entity] AS [American Case] GROUP BY Case. This should give the field as value of Y if any American city is involved.

Might need a bit more thought, but its just an idea.

Regards

effinty2112
Honored Contributor

Re: Scripting Issue

Hi Ben,

              Try:

=Count(DISTINCT aggr(sum(if([American Entity] = 'Y',1)),Case))    <= Wrong!!!

=Count(Aggr( if(aggr(sum(if([American Entity] = 'Y',1)),Case)>0,1),Case))

Cheers

Andrew

richard_chilvers
Contributor III

Re: Scripting Issue

This is similar to my idea, and is worthwhile if the number of American cities is required for each 'case'.

Community Browser