Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with aggr max in straight table

Hello dear community,

I'm stuck on a silly problem.

I have the following table:

Capture.PNG

In a straight table I wish to display only the lines which confirm to the following rule:

Max of sequence for a given key.

I tried aggr(max(Sequence),Key), but it is for some weird reason picking out line 1 and 5.

Attached a sample app.

Thank you in advance for getting me unstuck!

Cheers

26 Replies
Not applicable
Author

I need to get the last value of the sequence, by Key, and that's why the grouping to get the latest status of the Key.

Not applicable
Author

SasiParupudi1

Its the sequence 6 and 7 that i'm trying to get. Any other suggestions?

Thank you,

Not applicable
Author

jontydkpi‌ Any other ideas ?

Not applicable
Author

dreamer4 Didnt really find a solution with firstsortedvalue(). Any other ideas?

Thank you

PrashantSangle

Hi,

Please find attached file might help you

I did some modification in script like

tst:
LOAD Sequence,
     Status,
     Key,
     product
FROM
[..\..\..\..\..\..\..\Desktop\Test1.xls]
(biff, embedded labels, table is Sheet1$);

Test:
Load Sequence as New_Seq,
Status as new_status
Resident tst;

test1:
Load max(Sequence) as New_Seq,
  Key as testK,
  product as testProduct
//  //Status as tst_Stats
Resident tst
Group by Key,product;

Then create stragiht table

with dimension testK,testProduct,new_status

and

Expression New_Seq

and check supress when value is Null from dimension tab for testK

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

hi,

in sort tab - select only numeric asc for sequence

sasiparupudi1
Master III
Master III

may be change the sequence dimension to a calculated dimension with the expression

aggr(max(Sequence),Key)


hth

Sasi

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Using Straight Chart

In Dimension have a calculated dimension as follow

=aggr(max(Sequence),Key) // Rename this as whatever you want in

Then add Status, Key, Product to dimension

Then in the Expression tab

have same expression

=aggr(max(Sequence),Key)

Then go to Presentation tab HIDE the expression

This should give you your expected result

Not applicable
Author

hello Gabriel,

With your solution it doesnt show the right status, it shows "New" for both, whereas it should display "Modified" and "Approved".

Not applicable
Author

It works! actually i have a more complicated example, but to simplify i made a small table.

But no other solution in chart options?

Thank you anyway 🙂