Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rammuthiah
Creator III
Creator III

Highlight misorder in Date

I have a projects with 6 sub projects say for eg. Project1 has subprojects1, subprojects2, subprojects3, subprojects4, subprojects5, subprojects6, subproject7, subprojects8 and subprojects9

 

Every sub projects should have to be completed after the previous subproject.

Project,SP,FinishDate(MM/DD/YYYY)

P1,SP1,  02/02/2019

P1,SP2,  02/04/2019

P1,SP3,  02/06/2019

P1,SP4,  02/12/2019

P1,SP5,  02/14/2019

P1,SP6,  02/13/2019

P1,SP7,  02/16/2019

P1,SP8,  02/20/2019

P1,SP9,  02/22/2019

Here SP6 finished before the SP5 finish date by 1 day. So I want to highlight the subproject SP6 and Project P1.

Labels (1)
1 Solution

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Good, that means we're almost there. You should create another IF with:

IF(Above(Project) <> Project, Black(), IF(.... [next one] 

Because every first one should be black of course.

Jordy

Climber

Work smarter, not harder

View solution in original post

18 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Rammuthiah,

Use this in the coloring part of your tables' field:

 

IF(Above Floor(Date#(FinishDate,'MM/DD/YYYY')) < Floor(Date#(FinishDate,'MM/DD/YYYY')), Black(),Red())

 

The floor and date# are used for the easiness of comparing the values. This can go wrong with date formats.

Jordy

Climber

Work smarter, not harder
rammuthiah
Creator III
Creator III
Author

If it is for single project, your code is fine. I am looking for several projects with subprojects. therefore I have to group it based on project

JordyWegman
Partner - Master
Partner - Master

No problem, then we extend it:

IF(Above(Project) = Project and Above Floor(Date#(FinishDate,'MM/DD/YYYY')) > Floor(Date#(FinishDate,'MM/DD/YYYY')), Red(),Black())

Jordy

Climber 

Work smarter, not harder
rammuthiah
Creator III
Creator III
Author

Hi Jordy,

Thank you for your valuable reply. Above function not working here for my scenario. While tried above(), it changes to null values. I hope because of not ordering the Project/Subprojects

JordyWegman
Partner - Master
Partner - Master

Hmm the sort shouldn't matter in this case. Are you sure that all your values are filled in the model? Can you maybe send a sample QVF?

Jordy

Climber

Work smarter, not harder
rammuthiah
Creator III
Creator III
Author

Plz find qvf and data  used for it

rammuthiah
Creator III
Creator III
Author

Data used and status is the correct output which has to be seen in QS output

JordyWegman
Partner - Master
Partner - Master

In the script it's even easier!

See the attachment for the solution. This is also more stable and not depended on your sorting.

Jordy

Climber

Work smarter, not harder
rammuthiah
Creator III
Creator III
Author

Thanks Jordy. I slightly modified the data which based on my requirement. P1 has some missing subprojects and P2 has some null dates. Is it possible checking for all dates of sub projects within project?

ProjectSub ProjectFinish Date
P1SP1  02/02/2019
P1SP2  02/04/2019
P1SP3  02/06/2019
P1SP6  02/13/2019
P1SP7  02/16/2019
P1SP8  02/20/2019
P1SP9  02/22/2019
P2SP3  02/06/2019
P2SP4  02/12/2019
P2SP5 
P2SP6 
P2SP7  02/04/2019
P2SP8  02/20/2019
P2SP9  02/22/2019
P3SP1  02/02/2019
P3SP2  02/04/2019
P3SP3  02/06/2019
P3SP4  02/12/2019
P3SP5  05/14/2019
P3SP6  05/15/2019
P3SP7  05/16/2019
P3SP8  05/17/2019
P3SP9  05/18/2019