Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Second where conditon is not working?

Hi,

I'm attaching my qvw file please go through it. In this file i've a qvd file with two where conditions the first condtion is working well but y the second condition is not working i don't know.

Can any one help me on this.

4 Replies
swuehl
MVP
MVP

Hi Jagan,

you are talking about that part of the where clause?

If(Len('$(vFailHydStatusCodeA)')>0,WildMatch(HydStatusCodeA,'$(vFailHydStatusCodeA)')>0,WildMatch(HydStatusCodeA,'*'))

It is hard to tell what is going on since we can't run the script, but maybe you should check the first wildmatch.

Since it is a string comparison, the format of you string may be important. I noticed that vFailHydStatusCodeA looks like numerical, but is formatted with a thousand separator.

Maybe I am looking into the wrong direction though. Could you tell us a bit more precisely what you mean with "not working"?

Regards,

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Swuehl,

I've a lot of where condition for the qvd file all are working good except this condition. All the other conditions are in same format only i.e with numeric values.

Ok,

-    Let you assume that there is one field with numeric values and you can catch this values in one variable         through  the listbox(i.e. GetFieldSelections(FieldName,',',50). Now you can pass the variable to another qvw      file.

-    In another qvw file you need to load qvd file based on this filter.

-    While loading qvd file we should make sure that..

Load * from Table1.qvd (qvd)

Where

     if variable is empty

          {

               load all values of the field

          }

    else

          {

               load the values which are the variable only

          }

;

swuehl
MVP
MVP

Hi Jagan N,

could you be a bit more precise what do you mean with not working?

If I look at your data (given that the 2. where clause is commented) of field HydStatusCodeA, I see numericals, formated with 10 decimal places.

If you include the where clause, I assume you want to filter that field with vFailHydStatusCodeA.

In your example, this variable is 1,454 and this number is not part of the values of field HydStatusCodeA.

So, if I read your script correctly,  the else part is being executed and you get all values of the field returned.

So I don't see a problem with your example right now, in other / your words, why it is not working.

Maybe you could point me to your failed expectation.

My original thought was, that using string comparison, format might matter (decimal places, thousand separator).

And IMHO you compare the values of field HydStatusCodeA in the input format (because we are acting in the where clause, before QV will apply its formatting).

Nevertheless this could work if the format doesn't matter (like for numbers < 1000, thousand separator doesn't matter).

Maybe you could change your WildMatch / string comparision to a numerical comparison (using num(vFailHydStatusCodeA) )?

Just an idea,

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Thanks swuel..

You are right the values should be match with field data...I got the solution after keeping num(HydStatusCodeA)..

Otherwise i should give exact matching values..