Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

"Else" part not working

Hi All,

This might be something very simple, but can't get it to work, don't know why.

I have if-else calculation and many more like the same in my script, when I am pulling the columns in a straight table (alongwith few other columns), what I observed is, qlikview won't show me the results from else part even though the condition is fulfilled for it.

For Ex:

if (isnull([Phase 2 ST_DT]), ((max([Phase 2 E_DT]) - [Actual C_DT])/30), ((max([Phase 2 E_DT]) - max([Phase 2 ST_DT]))/30)) as [2_Dur_shyamal]

It will show the value [2_Dur_shyamal] only when [Phase 2 ST_DT] is null, otherwise it will be blank.

On the other hand, if I am using these calculations individually as expressions, it works fine.

But I would like to have all these calculations done in script rather in expressions

Any ideas on this?

32 Replies
Not applicable
Author

Thanks for your response.

But I am still getting the same issue, calculates the "IF" part and skips "ELSE" part.

Not applicable
Author

Thanks for the reply.

Can you please explain the purpose of field "GR" and left join between the tables?

Not applicable
Author

Hi All,

Finally, I found the solution .

Just for the reference of anyone who comes across this thread:

I created a Temp table to get the Max of all the date values, then used these fields in second table to do all the calculations. One slight change which I did in the calculation is:

if (IsNull([Phase 2 ST_DT])=-1

And so on for all the other phases and it worked like a charm.

Thank you all for all the suggestions and responses.