Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
pranaview
Creator III
Creator III

How to make an If condition work in the front end text box expression

Hi Guys,

Requirement: I have Process flow made out of  multiple Text boxes which are programmed as in they show a value (TAT)  and based on that value I set the color of the boxes. Now each Text box represents a task of a Request Id. So, for one Request Id, there could be 15-20 tasks. Each task has it's own status. What I need to do here is to check the status of the task first and if it's Open then I have to set the color of that specific text box to say Blue irrespective of the value that i'm showing in it. 

Problem: I wrote the if condition based on the above requirement but understandably the color of the box changes to blue only when i select that specific task from the filter but that's not what i need. The color of box should change to blue once the user selects that Request Id from the filter.

I hope I have made the problem understandable and i would appreciate any sort of help as this is kind of a blocker.

Thanks,
Pranav

 

Labels (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Hi Pranaview/ <a better name>,

Like 'a picture is worth a thousand words'  , a sample app is worth thousand guess works. Try to share a sample. 

 

If there there are multiple tasks for a request id, your expression like - if(Task = 'Task1', Blue()) itself should not work without selecting a task unless you are using set analysis or some aggregation function with other function. That is where I fail to think of your expression or the case itself. 

View solution in original post

6 Replies
tresesco
MVP
MVP

Since there could be multiple tasks for one request id, I am assuming these tasks could also have multiple statues (i.e. - one is 'open' the others could be 'closed' as well), and if the requirement is if ANY of the statuses is OPEN, you need the color change, - you could try like:

If(Min(StatusField='Open')= -1, Blue())

pranaview
Creator III
Creator III
Author

Thanks for the response Tresesco!

Like you rightly understood, one request can have multiple tasks and each task has it's own status.So, the requirement is kinda task based. So, when a Request Id is selected, I have to change the color of the text boxes of only those tasks which are Open to Blue. Rest of the tasks (Closed) will have the color based on their value. 

 

tresesco
MVP
MVP

How do your expressions look for textbox various tasks? Explanation with a sample could be great.

pranaview
Creator III
Creator III
Author

Hi Tresesco,

The expression without taking the task status into account is fairly simple. I use the variables which have the calculation for the value that i am showing in the text boxes and based on the value, i set colors i.e Red,Green,Amber. Now we want to include another condition which will be based on the task status i.e. If(TaskStatus = 'Open',Blue()) and that's it, no need to check the calculated value. So first what i did was to add the following condition 

If(TaskStatus = 'Open' and Task = 'Task1', Blue(), Check for calculated value and assign color)

Task1 being the Task for which i am writing this color condition in the text box(Each Task has it's own text box and should be assigned color independent of others). But with this expression, It will only turn to Blue when the Task1 is selected of course but if i don't add Task = 'Task1' condition then all the tasks turns to blue which obviously is incorrect.

Did i make it clear? if not then please let me know.

 

     

tresesco
MVP
MVP

Hi Pranaview/ <a better name>,

Like 'a picture is worth a thousand words'  , a sample app is worth thousand guess works. Try to share a sample. 

 

If there there are multiple tasks for a request id, your expression like - if(Task = 'Task1', Blue()) itself should not work without selecting a task unless you are using set analysis or some aggregation function with other function. That is where I fail to think of your expression or the case itself. 

View solution in original post

pranaview
Creator III
Creator III
Author

Hi Tresesco,

Yeah So, in the end I had to use set analysis as you know the If condition in itself wouldn't work unless a task is selected but using a set expression inside the If condition it worked.

anyway thanks for help and I'm gonna tick your response as the solution since you also rightly mentioned about using set analysis.

Pranav