Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

anders_billfors
New Contributor

Group by 2 fields and include additional columns on the same row.

See the included QVW file for full description of my question along with an inline table with sample data.

Basically what I want to do is group the rows by Id and Tstamp and see the properties assigned_to, assignment_group and state on every row.

If the properties did not change on that grouped timestamp I want the fields to contain a null value instead..

Like for example on the Id 2 and Tstamp 2014-03-06 15:14:33 the only thing that changed was the state, meaning assigned_to and assignment_group are null.

I've had issues to show the three properties on every "group by" and if I group by all of the fields I get additional fields with the same timestamp and I don't want that.

I hope my problem makes sense to anyone and check out the included file for a deeper explaination of the "workflow" I had in mind.

1 Solution

Accepted Solutions
Employee
Employee

Re: Group by 2 fields and include additional columns on the same row.

I've attached a quick solution.

Two notes though:

1. I only added one row from the missing external table (for the initial states)

2. The code relies on the fact that the Tstamp is always the same for two rows for "state" and "assigned_to" that are to be joined.

Regards,

Hampus von Post

2 Replies
Employee
Employee

Re: Group by 2 fields and include additional columns on the same row.

I've attached a quick solution.

Two notes though:

1. I only added one row from the missing external table (for the initial states)

2. The code relies on the fact that the Tstamp is always the same for two rows for "state" and "assigned_to" that are to be joined.

Regards,

Hampus von Post

anders_billfors
New Contributor

Re: Group by 2 fields and include additional columns on the same row.

Thanks alot, I just had a chance to look quickly but as I said the first problem I had was getting the propeties in place for the first step, the "group by" sequence.. Seems I had missed the Only() function.

Much appriciated. I think I can adapt this to my needs If not I might be back for some more help

Community Browser