Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
blunckc1
Creator
Creator

Logic help

Hi everyone,

I have the following data model.

Table 1 - Objectives

Objective_Title

Table 2 - Tasks

Task_Title

Task_Status

Objective_Title

Table 1 contains a unique Objective_Title in each row of data.

Table 2 will contain the Objective_Title multiple times as there are numerous tasks for each.

Table 1 and 2 are obviously linked through the Objective_Title.

My problem is that I need to be able to identify the current status of the Objective_Title based on the Task_Status.

Here is some script to load:

LOAD * INLINE [

    Objective_Title

    Qlik Development

    SharePoint Development

    Qlik Training

    Sharepoint Training

];

Tasks:

LOAD * INLINE [

    Task_Title, Task_Status, Objective_Title

    Get data, Complete, Qlik Development

    Build data model, In progress, Qlik Development

    Pilot with end user, Not yet applicable, Qlik Development

    Business case for SharePoint, Complete, Sharepoint Development

    Build site, Complete, Sharepoint Development

    Test site, Complete, Sharepoint Development

    Launch site, Complete, Sharepoint Development

    Identify end users, Complete, Qlik Training

    Book training rooms, In progress, Qlik Training

    Run training, Not yet applicable, Qlik Training

];

I want to create a new table in the load script bthat would have:

Objective_Title

Objective_Status

The results of this table would be:

   

Objective_TitleObjective_StatusReason/Commentary
Qlik DevelopmentIn progressNot ALL tasks linked to this objective has a Task_Status of "Complete"
Qlik TrainingIn progressNot ALL tasks linked to this objective has a Task_Status of "Complete"
SharePointDevelopmentCompleteALL tasks linked to this objective has a Task_Status of "Complete"
SharePoint TrainingUnassignedThere are no tasks with linked to this objective

This way I could create a pie chart where by the Objective_Status is the Dimension and can use the expression of Count(Objective_Title).

Any suggestions?

Thanks

Carl

Message was edited by: Carl Blunck

8 Replies
rahulpawarb
Specialist III
Specialist III

Hello Carl,

Thank you for sharing your concern. It would handy if you could help us by providing some sample data with expected output. This will help us to share our thoughts on this.

Regards!

Rahul

sdmech81
Specialist
Specialist

Do left join btn 1and 2and table.

Then write the same if  statement and store in one attribute using the resident load from above join result table.

Use join don't apply map else it ll consider only latest row for task status.

Sachin

vinieme12
Champion III
Champion III

Assign numeric value to [TaskStatus] field during load and then use Maxstring(TaskStatus)

Load

Dual(Taskstatus,pick(Match(TaskStatus,'Unassigned','inProgress','Completed'),0,1,2)) as TaskStatus

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
blunckc1
Creator
Creator
Author

Hi all,

Here is some script to load:

LOAD * INLINE [

    Objective_Title

    Qlik Development

    SharePoint Development

    Qlik Training

    Sharepoint Training

];

Tasks:

LOAD * INLINE [

    Task_Title, Task_Status, Objective_Title

    Get data, Complete, Qlik Development

    Build data model, In progress, Qlik Development

    Pilot with end user, Not yet applicable, Qlik Development

    Business case for SharePoint, Complete, Sharepoint Development

    Build site, Complete, Sharepoint Development

    Test site, Complete, Sharepoint Development

    Launch site, Complete, Sharepoint Development

    Identify end users, Complete, Qlik Training

    Book training rooms, In progress, Qlik Training

    Run training, Not yet applicable, Qlik Training

];

Expected result would be a new table in the load script being created that would have:

Objective_Title

Objective_Status

The results of this table would be:

   

Objective_TitleObjective_StatusReason
Qlik DevelopmentIn progressNot ALL tasks linked to this objective has a Task_Status of "Complete"
Qlik TrainingIn progressNot ALL tasks linked to this objective has a Task_Status of "Complete"
SharePointDevelopmentCompleteALL tasks linked to this objective has a Task_Status of "Complete"
SharePoint TrainingUnassignedThere are no tasks with linked to this objective

This way I could create a pie chart where by the Objective_Status is the Dimension and can use the expression of Count(Objective_Title).

Cheers

Carl

blunckc1
Creator
Creator
Author

See below

Anil_Babu_Samineni

Where is this Reason coming from?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
blunckc1
Creator
Creator
Author

Reason is just commentary to show why that result should be produced.

Not sure how to achieve that through script logic, hence the thread

Anil_Babu_Samineni

Not clear to me well. What is the logic behind to do this? Don't look script try from Front end if so will catch up in script too. Would you describe more

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful