Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Count or If statement

I am trying to Count all the Shirts that are blue with orders less that 240. However I am putting this data in a filter and keep getting invalid dimension.

Below is the expressions that I wrote. I get an OK from the expression check in Qlik Sense but no display. Not sure what I am doing wrong but any help would be appreciated.

=Count({$<Shirts = {'Blue'} >} [Shirt Orders]<240)

another Expression

=If(Shirts = 'Blue',Count([Shirt Orders]) <240)

Kurleigh

9 Replies

Re: Count or If statement

May be this

If(Count({$<Shirts = {'Blue'}>} [Shirt Orders]) < 240, Count({$<Shirts = {'Blue'}>} [Shirt Orders]))

Re: Count or If statement

Or this

Count({<Shirts = {'Blue'}*{"=Count({$<Shirts = {'Blue'}>} [Shirt Orders]) < 240"}>} [Shirt Orders])

Not applicable

Re: Count or If statement

Thanks,

I tried the first expression and it returned a blank result. Not sue why I can def see their are blue shirts with orders less that 240.

The second expression gave me and error.

neha_shirsath
Valued Contributor

Re: Count or If statement

try with this-

if(Shirts='Blue' and [SHirt Orders]<240,Count([SHirt Orders]))

pathiqvd
Contributor III

Re: Count or If statement

Hi,

Try This,

=count({<Shirts={"Blue"},[SHirt Orders]={"<240"}>}[SHirt Orders])

Regards,

Partner
Partner

Re: Count or If statement

Hi,

Try both conditions in set.

Count({<Shirts ={"Blue"},[Shirt Orders]={"<240"}>} [Shirt Orders])

MVP
MVP

Re: Count or If statement

I guess if Shirts actually holds color code, there has to be a separate field for shirt itself, may be like ShirtCode. And then, you perhaps could try like:

Count( DISTINCT {<ShirtCode={"=Count({<Shirts={'Blue'}>} [Shirt Orders])<240"}>}ShirtCode)

Note: Adjust the fields in your context.


Edit: DISTINCT

passionate
Valued Contributor

Re: Count or If statement

Hi Henry,

Provide some data dumps.

The above solutions must work.

Regards,

Pankaj

Not applicable

Re: Count or If statement

Thanks Lakshmipathi,

Your solution with what I was looking for. Also,Thanks everyone for chiming it with help.