Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Prob in Script

Hey,

In my dashboard, i am fetching data from OLEDB source. Now, there is a Field "BusinessGroup" in databse.

Now if BusinessGroup = 'ABC%' Then ABC else fetch Desk field values from flat file.

How can i do this in script??

1 Solution

Accepted Solutions
pokassov
Specialist
Specialist

Hi Nikhil!

If I understood you correctly, you have some key field in table.

You may do this:

t1:

mapping load

keyfield,

businessgroup

from <your local file>;

oledbtable:

load

keyfield,

if(BusinessGroup='ABC%','ABC',applymap('t1',keyfield,null()) as BusinessGroup;

sql select

keyfield,

businessgroup

from <your oledb source>;

View solution in original post

11 Replies
Not applicable

hi,

Send sample of script.

you can use like

LOAD *;

select sql *

from oracle.tablename where BusinessGroup like( 'ABC%');

Regards

Vimlesh

senpradip007
Specialist III
Specialist III

Can you be more collaborative?

pokassov
Specialist
Specialist

Hi Nikhil!

If I understood you correctly, you have some key field in table.

You may do this:

t1:

mapping load

keyfield,

businessgroup

from <your local file>;

oledbtable:

load

keyfield,

if(BusinessGroup='ABC%','ABC',applymap('t1',keyfield,null()) as BusinessGroup;

sql select

keyfield,

businessgroup

from <your oledb source>;

nikhilgarg
Specialist II
Specialist II
Author

Well sample is like:

OLEDB connection ;

LOAD A,

B,

C,

D,

if(E LIKE 'DCM%' , 'DCM' , (have to fetch Desk field value from excel sheett));

Select......

Thanks

nikhilgarg
Specialist II
Specialist II
Author

Well sample is like:

OLEDB connection ;

LOAD A,

B,

C,

D,

if(E LIKE 'DCM%' , 'DCM' , (have to fetch Desk field value from excel sheett));

Select......

Thanks

fvelascog72
Partner - Specialist
Partner - Specialist

Try this:

LOAD

     if([BusinessGroup] like 'ABC*', 'ABC', [Desk])          as "FIELD",

FROM.....

sujeetsingh
Master III
Master III

First load the data from database as well as Flat file in Qlik.

Left join or join the both based on the Key and then derive the column as

if (left(BusinessGroup,3) = 'ABC' ,ABC , Desk) as New Filed

nikhilgarg
Specialist II
Specialist II
Author

Hey,

I tried your way but prob is i am loading like:

Load Table A(having business group filed)

Left Join

Load Table B(having Desk field).

So your statement is not working fine as throwing exception Desk field not found:

if (left(BusinessGroup,3) = 'ABC' ,ABC , Desk) as New Filed

Not applicable

hi,

you want to create a field or filter only ABC related data.

use wildmatch function.

Regards

Vimlesh