Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
gbarrett
Partner - Contributor III
Partner - 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
swuehl
MVP
MVP

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
Partner - Contributor III
Partner - Contributor III
Author

Yes I have a background color expression:

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

swuehl
MVP
MVP

Try something like

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