Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR June 25, 2025: Build on Apache Iceberg with Qlik Open Lakehouse - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
michaelsmith
Contributor III
Contributor III

Ignore User Selections For Dimension

I have a table object which reports records for the last year.  Data is limited by an if statement in the dimension i.e. if the record date is within the last year then include it within the table.  The application also has a number of user filters including year, quarter and month - these are important filters for use in other charts within the same applications and cannot be excluded. The problem that occurs when one of these is selected is the it further limits the number of records that are presented in this specific table.  I want to be able to show all records within the last year regardless of the users time filter selections.

I recognise that user filter selections can be ignored in set analysis, but is there any way of doing the same sort of thing in an if statement?  That being said, I know you can detach a chart, but this would ignore all user filter selections.  I just want to be able to have it ignore the year, quarter and month filters...

If there any way of doing this?

7 Replies
sunny_talwar

You can do it, but it would be easier to guide if you can share a your calculated dimension as well as your expression.

michaelsmith
Contributor III
Contributor III
Author

Sunny,

I may have fathomed out a workaround, but I'd be keen to hear your suggestion for future reference.    Please find the requested data below:

Dimension:

=IF(End_Date>=DATE(TODAY()-365) AND FLAG = 0,EMP_Ref)

Expression:

=Count(distinct ABS_Ref)

settu_periasamy
Master III
Master III

May be look on "Alternate State"

swuehl
MVP
MVP

No, you can't ignore user selections in an if() statement without using set analysis (or working in a different alternate state).

Basically, these are two different things: manipulating the record set using set analysis and creating an expression that works / iterates over that defined record set.

There are means to apply set analysis also to the calculated dimension (using advanced aggregation and aggregation functions), but you would need to use set analysis.

gsbeaton
Luminary Alumni
Luminary Alumni

Hi Michael,

If it's a Table Box object, you are limited to what you can do.  Putting it in an alternate state, and then setting up field triggers based on the selections in the default state would be about the only solution.

If it's a straight of pivot table you have more options.  I presume your date fields are your dimensions in the table, so then your expression needs to be just as simple as something like sum({<month=, year=>}orders)

Hope that helps

George

sunny_talwar

Try this:

Aggr(Only({<End_Date = {"$(='>=' & Date(AddYears(Today(), -1)))"}, Flag = {'0'}, Month, Year, Quarter, MonthYear>} EMP_Ref), EMP_Ref)

or may be this

=Count(distinct {< Month, Year, Quarter, MonthYear>}ABS_Ref)

gsbeaton
Luminary Alumni
Luminary Alumni

Hi Michael,

Can I suggest a better way of doing this in future might be with a date calendar with a 'PrevYear' flag column.  Your dimension and expression would then look like this:

Dimension

Date

Expression

Count({$<PrevYear={1}, Year=, Month=>} DISTINCT ABS_Ref)

This will be more performant than a calculated dimension too.

Cheers

George