Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

How to get the last Status "Approval" that no contains Status "Complete"

Hello!!

I have the table transactions where I have "Status" Like New, Approval And Complete. When I do click over Approval Transaction, QlikView counts all the status Approval, but this include the status Complete when the document ending for that state. What I want is to do Click over Approval but QlikView doesn´t have to count the document that has "Complete" State. I mean, The last state has to be Approval only and no to count the Approval that contains State Complete . I hope that you have undertood the question.

Thanks!!

1 Solution

Accepted Solutions
Not applicable

Hi there....take a look at the attachment. Guess that should be something you're looking for.

View solution in original post

9 Replies
Not applicable

Try: =Count({<[Status 2]-={"=Count({1<Status={'Complete'}>} Status)"}>}
distinct [Status 2])

When Approved is selected, it is Status 2s that are Approved, but not Complete. When nothing is selected for Status, then it is Status 2s that aren't Complete.

pgalvezt
Specialist
Specialist
Author

I think that my explanation it was not very good. Sorry about that. I´ve created a new table called "Code". the idea is count just the codes that contains Approval withouth complete. For this example QlikView should count "5" Approval State. Both codes 001 and 002 must be out.

ExampleStatus.JPG

Thanks!

Not applicable

try something like: count({$<Status = {'Approval'}>}Code) will count only Approvals

pgalvezt
Specialist
Specialist
Author

Yes, you're totally correct, but QlikView with that analysis counts all Approvals this include all the state Complete. The idea is to leave the Status complete out. Should counts "5" because 001 is a new document, then passed for approval and then Complete. This document shouldn´t counts. 003 to 007does.

Thanks!

Not applicable

NMillers suggestion should have worked with your example.

You may try this also:

Count({<[Status2] -={"=Count({1<Status={'Complete', 'New'}>} Status)"}>} [Status2])

pgalvezt
Specialist
Specialist
Author

Thanks for yor replys. QlikView with your analysis counts "2". QlikView should count "5". The code 001 ends in Complete. Look:

001 New

001 Approval

001 Complete

002 Complete

003 Approval

004 Aproval

001 contains New, Approval and Complete. QlikView should´t count this register because contains Complete.

Thanks!

Not applicable

Hi there....take a look at the attachment. Guess that should be something you're looking for.

pgalvezt
Specialist
Specialist
Author

Excellent. Very Thanks. Just one more thing. Could you explain the Expression Code please?

Thanks again!

Not applicable

Essentially I tried to count the status by code. Flag Code(s) with more than or equal to 2 status counts. What would have been ideal is putting this logic in the script itself. Iterate thru the table (with a For - Next) and check for Status per Code group. Flag such Code groups in the script itself then use the flag directly at the Codes.