Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

gbarrett
New Contributor III

Straight Table Set Analysis Question

I have a straight table with multiple columns of dimensions and one column of an measure. The measure is simply an ID field with no aggregation, but a color expression. I have a field named CurrentFlag that I would like to use in set analysis. I only want to display rows where the CurrentFlag field value is 1. I tried adding set analysis to the expression like so: {<CurrentFlag={'1'}>}ID. However, this results in an error. Looking at another post I tried using: Only({<CurrentFlag={'1'}>}ID), which didn't result in an error, but it only hid the ID numbers and not the entire rows. Does anyone have a solution to hide the entire row if the flag is not 1? This must be handled in the front end.

Thanks.

3 Replies
MVP
MVP

Re: Straight Table Set Analysis Question

In general, use aggregation functions in expressions

Use Aggregation Functions!

Only() is an aggregation function, so that's what you probably should use here.

You can use set analysis only in aggregation functions, so that's one more reason to use one.

Now to your issue. I believe

Only({<CurrentFlag={'1'}>}ID)



Should filter your ID dimension, but maybe your color expression comes into play. How does it look like? Have you added a set expression also to your color expression?

gbarrett
New Contributor III

Re: Straight Table Set Analysis Question

Yes I have a background color expression:

if(STATUS='Open',if(DaysOpen = 1, yellow(),if(DaysOpen > 1, red())))

MVP
MVP

Re: Straight Table Set Analysis Question

Try something like

if(Only({<CurrentFlag = {1} >}STATUS)='Open',if(Only({<CurrentFlag = {1} >}DaysOpen) = 1, yellow(),if(Only({<CurrentFlag = {1} >} DaysOpen) > 1, red())))

Community Browser