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: 
Not applicable

Using several aggregations in one expression, need help

Hello all,

I have an issue with an expression, maybe someone can help me with it.

My example data set consists of products, which have several series. First series is something I am interested in. In every series a product can have several colors. For each color there are some process steps that should be completed, every process step has a status.

data set.jpg

I need to define the minimum status for every process step. The calculation should be dynamic depending on what product color I select, though always be based on first series.

If we take a look at the product 273 without color selection, then we have following set (step: min status)

200:3

205:3

210:3

..

390:4

395:4

400:5

405:5

..

490:6

500:6

In the expression I need to show the "jumps" of the statuses, at what process step the status changes so to say. Thus my expression should give following result if no color is selected: 3:200, 4:390, 5:400, 6:490.

expr to be no color.jpg

If I select blue, then my set changes to 200: 4, 205: 4, ..400:5, 410:5, ..., 490:6, 500:6 and the "jumps" look like this 4:200, 5:400, 6:490.

example blue.jpg

The same way the result will look like if I select red color, since the process steps and status are identical with blue:

expr to be blue color.jpg

It is important, that dimension of the chart is only the product id, so that I have always one line per product.

That is why I use aggr() function, but unfortunately I can only get the minimum process step per each status which results 4:200 instead of the right 4:390. I also have a problem with nulls.

4 200 wrong.jpg

I thought on having an if clause for process step to be greater than the maximum process step of the previous status, but I get an "nested aggregation is not possible" error.

Attached is an .qvw example.

I hope I could explain it so that everyone can understand what the result should look like. I look forward to your hints.

Thanks,

Marina

1 Solution

Accepted Solutions
Not applicable
Author

I fixed it on my own, got the minimum status for each process step and the worked with string functions looking for the first occurrence of each status

View solution in original post

1 Reply
Not applicable
Author

I fixed it on my own, got the minimum status for each process step and the worked with string functions looking for the first occurrence of each status