Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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

 

 

Labels (1)
2 Replies
Anil_Babu_Samineni

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

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
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