Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello qlikview experts,
i need to understand the if condition in qlikview.
In my scenario I am using the if condition in my script level.
For eg:
if( FLAG ='X', [Earliest DATE], [END DATE]) as plan Date
also let
[Earliest DATE] = 1/1/2015
[END DATE] = 12/1/2014
here the data modeling is done such a way that flag = 'X' exists for both the feilds [Earliest DATE] & [END DATE].
As per my understanding I should get answer as 1/1/2015 which is in [Earliest DATE] feild as FLAG ='X' holds the condition true.
But in my condition it is taking value for both if and else condition.
for eg. both 1/1/2015 & 12/1/2014 in the list box which gives me error in further calculations.
If the condition is true it should take the only the first value. I have tried the same condition with other inline table it is giving me proper answer.
I am confused where I am wrong.
Please help
Hello Bhumika,
Just wondering how feasible it is to upload a sample qvw file so that we can work on it quickly.
Regards,
V.
Hello vishsaggi,
Thanks for the instant answer.
But could not attach any kind of sample file from the office due to the security constraints.
I have got the root cause of the issue as it is creating the two rows and taking both the values.
Regards
Bhumika
I can only confirm that your understanding of the if() function is correct.
What is going on in your situation - can't tell without an example. You don't need to upload the actual application, just create simple example where you can reproduce the issue.
May be your Flag value is not being reset properly in your script..As far as the if condition is concerned, it looks fine
Please try
if( '$(FLAG)' ='X', [Earliest DATE], [END DATE]) as plan Date
Could not understand 'the data modeling is done such a way that flag = 'X' exists for both the feilds [Earliest DATE] & [END DATE]' . Can you elaborate this?
Regards,
KKR
Hello all
I have got the root cause of the issue as it is creating the two rows and taking both the values.
So, I was getting the unexpected result.
thanxx
Great to know that your problem is resolved.Please close the thread with your resolution and marking the correct answer