Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If condition is not working problem in edit script?

Hi

I've xlx data like below format.

     CTCateg

     No Read

     ExLow

    OS Low

    High     

    No Read    

    Ex Low    

    OS Low 

- I've one varaible which consist data like NoReads,GoodReads,MissingReads

- while loading itself the data should check based on the varaible for dat i written below code..

Table1:

LOAD CTCateg

FROM

[..\2_QVDGenerator\Book1.xlsx]

(ooxml, embedded labels, table is Sheet1)

Where if(SubStringCount('$(vCtCateg)','NoReads')>0, CTCateg ='No Read',if(SubStringCount('$(vCtCateg)','GoodReads')>0, CTCateg>0,CTCateg<=0))

;

- Here the condition is if varaible is equal to NoReads it should display only No Read data or if varaible is equal GoodReads it should display other than NoRead and null values or if variable is equal to MissingReads it should display only null values.

But i'm not getting exact data..Can anybody help on this..

For ur reference i'm attaching my xls and qvw file also.

1 Solution

Accepted Solutions
llauses243
Creator III
Creator III

Hi,

This is my offer, with same result as Jhon Duff but with only a Load

Good luck, Luis

View solution in original post

5 Replies
Not applicable
Author

Hi jacq,

as far as I understood you,my exam app should point into right direction

Note:

For testing purposes I used an inline-table as source.

I do not need a variable.

HtH

Roland

john_duffy
Partner - Creator III
Partner - Creator III

Hello.

I have attached an example if which I create a resident table from the spreadsheet to determine Read Type.  Using this field and the variable, I use the mixmatch command to determine which records to process.

Let me know if this helps.

John.

Not applicable
Author

Roland,

I want to load the application based on variable. It is mandataory for my application.

John

Your example is fine. But i'don't want to load table data two times(i.e with help of resident load) in my application b'coz i have to load more than 100 fields based on this condition and other conditions for other fields also.

Thanks a lot for sharing your idea.. At lost i got solution for my task myself.

Code is:

    

Table1:

LOAD CTCateg

FROM

[..\2_QVDGenerator\Book1.xlsx]

(ooxml, embedded labels, table is Sheet1)

Where

(if(SubStringCount('$(vCtCateg)','NoReads')>0, CTCateg ='No Read')

or if(SubStringCount('$(vCtCateg)','GoodReads')>0, CTCateg>0 and CTCateg <> 'No Read')

or if(SubStringCount('$(vCtCateg)','MissingReads')>0, CTCateg<=0))

;

llauses243
Creator III
Creator III

Hi,

This is my offer, with same result as Jhon Duff but with only a Load

Good luck, Luis

Not applicable
Author

If the variable is empty i want to load all the values of CTCateg..

Can anyone help me according to above examples.