Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

lnasadoski2
New Contributor

Conditional row display in straight table

I am very new, so this is probably an easy thing that I just can't do as a beginner.

I have a straight table that is counting degrees for a given student.

I only want to display the rows where degree-count is greater than 1.

I tried the following 'if', but it does not omit the counts that = 1.

Any ideas on how to apply a condition to this expression?

if(count([Degree Counter] > 1),count([Degree Counter]), null())

1 Solution

Accepted Solutions
vgutkovsky
Honored Contributor II

Conditional row display in straight table

You can do this without aggr, which will be much lighter in terms of memory and CPU consumption: sum({<Name={"=sum([Degree Counter])>1"}>}[Degree Counter])

Note that this assumes that "Degree Counter" is a flag that can be summed, and is joined correctly to the rest of your data model. If you post a reduced example app, I can check it for you in case this produces unexpected results.

Regards,

Vlad

View solution in original post

5 Replies
Not applicable

Re: Conditional row display in straight table

Try this sum(if(aggr(count([Degree Counter],student)>1,count([Degree Counter]))

Regards,

Kiran.

lnasadoski2
New Contributor

Re: Conditional row display in straight table

I modified your suggestion by replacing <student> with <Name> assuming that was to be the unique 'group by' field.

I had to add two end-parenthesis and I was not clear on where to add them.  Now I do not get any rows in my table.

Do you see any issue with what I've done?

sum(if(aggr(count([Degree Counter]),Name) >1,count([Degree Counter])))

lnasadoski2
New Contributor

Re: Conditional row display in straight table

I modified your suggestion by replacing <student> with <Name> assuming that was to be the unique 'group by' field.

I had to add two end-parenthesis and I was not clear on where to add them.  Now I do not get any rows in my table.

Do you see any issue with what I've done?

sum(if(aggr(count( [Degree Counter] ),Name) >1,count( [Degree Counter] )))

vgutkovsky
Honored Contributor II

Conditional row display in straight table

You can do this without aggr, which will be much lighter in terms of memory and CPU consumption: sum({<Name={"=sum([Degree Counter])>1"}>}[Degree Counter])

Note that this assumes that "Degree Counter" is a flag that can be summed, and is joined correctly to the rest of your data model. If you post a reduced example app, I can check it for you in case this produces unexpected results.

Regards,

Vlad

View solution in original post

lnasadoski2
New Contributor

Conditional row display in straight table

Thank you so very much!