Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Sahal
Creator
Creator

Group by with aggr()?

Hi,

I have a table that looks like this:    

   

UserModifiedTimeChangeTypeSource DocumentOUTPUT
po442016-03-31 08:46UpdateTest2.qvwCreated
po442016-03-31 08:46UpdateTest2.qvwWhatEverChangetypColumnHave
po442016-03-31 09:00UpdateNew QlikView Document.qvwCreated
po442016-03-31 09:10UpdateNew QlikView Document.qvwWhatEverChangetypColumnHave
po442016-03-31 09:22DeleteNew QlikView Document.qvwWhatEverChangetypColumnHave
po442016-03-31 09:24DeleteTest2.qvwWhatEverChangetypColumnHave
po442016-03-31 09:31Updateframe.qvwCreated
PO492016-03-31 08:51UpdateTest2.qvwWhatEverChangetypColumnHave

I want to create a dimension column that looks like the OUTPUT Column.

As you can see i would like to use (if possible) the aggr() function or something within the chart that groups by sourcedocument
,user and modefiedtime.

when a new sourcedocument is added then "created" value will appere insted of "update" but this is only when there is a new sourcedocument added and that is why i think i need to group by because if you have a look at the last row for user PO49 the same sourcedocument appers but the document is already there and should not be "created".

I have playd around with the min() function for modified time but not sure exactly how to use with aggr().

1 Solution

Accepted Solutions
Sahal
Creator
Creator
Author

Hi,

I got this to work:

if(isnull(Rank(Total Aggr(Sum(ModifiedTime), [Source Document]))),ChangeType,'Created')

Only sort by ModifiedTime Ascending

Thanks to this topic Row numbering by two dimension

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe create a chart like this

Dimensions:

Source Document

ModifiedTime

Sort chart by Source Document and ModifiedTime ascending.

As expression:

=If(Rowno() = 1, 'Created', Only(ChangeType) )

Other fields can be added as well to the expressions, if you need them to show.

Sahal
Creator
Creator
Author

Hi,

I got this to work:

if(isnull(Rank(Total Aggr(Sum(ModifiedTime), [Source Document]))),ChangeType,'Created')

Only sort by ModifiedTime Ascending

Thanks to this topic Row numbering by two dimension