Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
joshm43
Contributor III
Contributor III

Suppressing Rows based on an Expression (Measure) Value

Hello -

I am building a straight table for a user activity report.  I want to be able to see only the last login date by user.  Here is what my notional table looks like.

username and LoginDate are dimensions.  The other two are measures - I've included the expression in "".

usernameLoginDateMax Login Date /  "MAX(TOTAL <username> LoginDate) "Date Test / "=IF(LoginDate = MAX(TOTAL <username> LoginDate), 1, 0)"
Agent18/3/20218/3/20211
Agent17/31/20218/3/20210
Agent16/15/20218/3/20210
Agent15/1/20218/3/20210
Agent28/2/20218/2/20211
Agent27/5/20218/2/20210
Agent37/31/20217/31/20211
Agent37/21/20217/31/20210
Agent37/11/20217/31/20210

 

What I want to be able to do is suppress those rows where the Date Test value is "0" (I can change this to a Null value if needed), so the table would look like:

usernameLoginDateMax Login Date /  "MAX(TOTAL <username> LoginDate) "Date Test / "=IF(LoginDate = MAX(TOTAL <username> LoginDate), 1, 0)"
Agent18/3/20218/3/20211
Agent28/2/20218/2/20211
Agent37/31/20217/31/20211

 

I am using an Enterprise version of Qlik Sense and do not have access to the load scripts, so whatever needs to be done needs to be done within the Table.

Any thoughts or suggestions are greatly appreciated.

Thanks, Mitchell

Labels (3)
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

what you need is a function called "FirstSortedValue". 

Create a table with Username as Dimension and below expression.

Date(FirstSortedValue(LoginDate,LoginDate*-1))

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

1 Reply
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

what you need is a function called "FirstSortedValue". 

Create a table with Username as Dimension and below expression.

Date(FirstSortedValue(LoginDate,LoginDate*-1))

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!