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: 
nareshthavidishetty
Creator III
Creator III

IF condition not working

Hi ,

I have used the below if condition but it is not giving correct results.

Condition:

=if(Len(Status_I_Min)= null(),

aggr(Interval(Status_A_Max-Status_Null_Min,'hh:mm:ss'),Application_Number),

aggr(Interval(Status_A_Max-Status_I_Min,'hh:mm:ss'),Application_Number))


Scenario(Please refer below image):

Condition for Total time taken to approve application  Column

if Total time taken to create application is null then show aggr(Interval(Status_A_Max-Status_Null_Min,'hh:mm:ss'),Application_Number) 

else

aggr(Interval(Status_A_Max-Status_I_Min,'hh:mm:ss'),Application_Number)

But here am not able to show the results if  Total time taken to create application is null.

Untitled.png

7 Replies
hector_munoz
Specialist
Specialist

Hi,

Change "Len(Status_I_Min)= null()" by "Len(Status_I_Min) = 0".

Regards,

H

nareshthavidishetty
Creator III
Creator III
Author

Hi,

I have tried it but no luck.

Thanks..

Anil_Babu_Samineni

Can you send latest expression which you tried

Can you try Simple '' or '0'

=if(Len(Status_I_Min)= '',

aggr(Interval(Status_A_Max-Status_Null_Min,'hh:mm:ss'),Application_Number),

aggr(Interval(Status_A_Max-Status_I_Min,'hh:mm:ss'),Application_Number))

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
jonathandienst
Partner - Champion III
Partner - Champion III

Where are you using this expression? All the fields are naked (ie not inside an aggregation function like Sum, Count, Max) and so will not return anything unless there is only one possible value where the expression is being evaluated. That's why you are getting nulls; and what purpose does the Aggr() serve?

I think the expression you need is (if Status_I_Min as an empty string or null):

     Sum(Status_A_Max - Alt(Status_I_Min, Status_Null_Min))

Format this to interval using the Property | Number for the table.

If Status_I_Min is zero, then:

     Sum(Status_A_Max - If(Status_I_Min <> 0, Status_I_Min, Status_Null_Min))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
nareshthavidishetty
Creator III
Creator III
Author

Hi,

We taking the time interval difference and i thin aggregation wont help us.

Thanks..

nareshthavidishetty
Creator III
Creator III
Author

Hi,

Still its not working.

Thanks..

Anonymous
Not applicable

Hi,

Did you try:

if(isNull(Status_I_Min) or len(trim(Status_I_Min)) = 0,

aggr(Interval(Status_A_Max-Status_Null_Min,'hh:mm:ss'),Application_Number),

aggr(Interval(Status_A_Max-Status_I_Min,'hh:mm:ss'),Application_Number))