Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Chart Expression (Return TestID Where TestDate is Max TestDate)

Data (in a Table Box) looks like this:

PersonIDTestFlagTestIDTestDate
1234B01D410F-4796-450D4/1/2010
12341C9B4F060-A6FF-4D35/5/2011
123437FD7369-075E-4CBC3/16/2011
1234F063F7A6-C055-46054/14/2011
1234AC5396D2-2454-4F924/29/2011
1234096F11C7-CEAB-414C5/11/2011
123416D02D475-56D8-4A1D6/6/2011
1234187BBA227-2036-482B10/17/2011


I'm trying to create a Straight Table that looks like this:

PersonIDTestFlagMOST RECENT TestIDMOST RECENT TestDate
1234187BBA227-2036-482B10/17/2011

In other words, please give me the most recent TestID and TestDate where the TestFlag = 1 (by PersonID).

Currently, I have the Dimension as PersonID, and my Expression looks like this:

MaxString(

{$<
TestDate = {"=$(Max(TestDate))"},
TestFlag = {1}
>}
TestID)
But this is not returning anything...
Please help.
1 Solution

Accepted Solutions
MVP
MVP

Re: Chart Expression (Return TestID Where TestDate is Max TestDate)

most recent test ID   = firstsortedvalue({<TestFlag*={'1'}>} TestID,-TestDate)

most recent test date = max({<TestFlag*={'1'}>} TestDate)

2 Replies
MVP
MVP

Re: Chart Expression (Return TestID Where TestDate is Max TestDate)

most recent test ID   = firstsortedvalue({<TestFlag*={'1'}>} TestID,-TestDate)

most recent test date = max({<TestFlag*={'1'}>} TestDate)

Not applicable

Re: Chart Expression (Return TestID Where TestDate is Max TestDate)

Wow! Thx so much, John! Seems to be working now

Community Browser