Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
PeterG
Contributor II
Contributor II

limit rows in straight table by specific unique values in expression editor

I am wanting to limit the rows in a straight table  to some unique values in one of the columns, and do so in the expression editor.  Basically get the same result when you use a selection filter to select some unique values and this then only sees the rows with these vales displayed.  In this case I want these unique values to be set in the expression editor and not changed.

The column containing the exact field is a unique record identifier and we want to fix this table to limit to some very specific identified rows that we are using for testing.

Labels (3)
2 Replies
Digvijay_Singh

Not sure of the exact need but I guess you want to fix some values for one dimension in the expression and you want your straight table to show rows only for these dimension values.

I think your straight table measure needs to have set condition like this - 

Sum({<AnotherDimColumn={'Value1','Value2','Value3'}>}Value)

Share some sample data or sample app in case your needs are different

PeterG
Contributor II
Contributor II
Author

Hi Digvijay,

thanks for the reply.  I had tried something similar in a previous attempt but received the same error when I add this to the expression editor for this column I get these unwanted result or error

 

The table has about 30 columns the first few columns are:

Has_Condition (possible values 1 or 0)

Org Code (20 possible codes)

RecordID (50,000 unique record IDs)

 

 

Underlying data set has 1Mil rows, where each RecordID has an entry per ReportingDate (where the ReportingDate possible values are the last date of of each month in this format (YYYMMDD)  i..e. 20230630 , 20230731, etc)  ReportingDate (data set contains about 50,000 records for each date).

Using  a Master Measure where IS_XXXCondtion  defines the Has-Conditon =1, a variable to apply a default ReportingDate selection filter to the Sheet/Table  of the latest possible date using   Sum({<%Month_No = {'$(vPerformanceMaxMonth)'}>}Is_XXXCondition) 

This is all working fine.

 

But when I try to add a  the specific RecordID's to the RecordID column I get the below results

 

In my first attempt

The column name RecordID I tried this in expression editor for that column

  ={<[RecordID] = {'ABC1234','XYZ5678'}>}[RecordID]

The result has no effect on the number of rows and I get the same result as if this column has =RecordID  i.e about 50K rows with all the unique IDs for that Month

 

When I used your suggestion

=sum({<[RecordID] = {'ABC1234' , 'XYZ5678'}>}[RecordID]

upon entering this is in the expression , where it says the expression syntax is OK, and hit  apply, the error gets displayed "Column - Invalid Dimension"

Any help would be greatly appreciated.