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: 
edupitel7
Contributor
Contributor

Trying to use A or B on if statement, but with two different formulas

Hi folks,

My problem is this: I'm trying to calculate the delay in a process    DELAY=today()- [date_process]

But I  have a dimension named "Stage", and for process in Stage=2 I will use a field named [date_process_2]

and for process in a Stage=3,4,5   I will use a field named [date_process_3_4_5]

But I want to write something like

if(delay>0 and delay<7, 'less than 7 days of delay,

if( delay > 7 and delay < 15, 'between 7 and 15 days of delay',

if(delay >15 and delay < 30, 'between 15 and 30 days of delay',

if(delay > 30, '>30 days of delay'))))

The problem is in my delay field I need to perform this if statement for each "delay" 

=today()-if(Stage=2,date_process_2,date_process_3_4_5) )

If I have 10 process with delay >30 days in Stage=2 and 5 process with delay>30 days in Stage=3,4,5

I want to click on this filter ">30 days of delay"  and select all this 15 process

The qlik understand that the two results are excludent by themselves

I need to choose or Stage=2 or Stage=3,4,5

But I want to bring these results together

 

I don't have access to the script  load section

I can't create variables either master measures

Thks guys

 

 

2 Replies
Anil_Babu_Samineni

Did you checked the "DELAY" field in the design how it is computing? 

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
edupitel7
Contributor
Contributor
Author

If I wrote without use aggr(if(xxx), Initiative Code) it FILTERS many correct values, but also some wrong values

 

Process with delay >15 for exemple appearing when i filter only <7 or between 7 and 15

I guess the problem is because if I need a different metric for formula, qlik will filter this condition and exclude the other metric results.

Then I need to double the code, writing "<7 days delay for case 2'"  "<7 days delays for case 3,4,5"

It works

But when I select "<7 days delay for case 2" it returns x projects

and when I select "<7 days delay for case 3,4,5" it returns y projects

 

I want to make both selections simultaneously and returns x+y projects

To find all the process with delay, in case 2 or 3,4,5

A U B     but A is mutually excluded with B

case 2  then not case 3,4,5

case 3,4,5 then not case 2

but with different metrics