Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksairam89
Creator
Creator

SQL Select statement

Hello,

I have a requirement we are currently hardcoding a list of Products. What we’ll need to do is to introduce the following new data source: Excel

That contains

Load*Inline[

DummyWorklists,category

ABCD,A

EFG,A

HIJK,A

LRTY,B

];

Note:And use all the Dummyworklist in the spreadsheet with the column Category = ‘A’


Existing Script:

SELECT actionid,

       queryid,

         Dummyworklists.worklist AS worklistname

      

FROM   Dummyaction,

       Dummyworklists

AND    action.worklistid = Dummyworklists.worklistid

AND    Dummyworklists.worklist IN ('ABCD',

                                                       'EFG',

                                                       'HIJK');


Can you help me to how to proceed with the script

9 Replies
Anil_Babu_Samineni

Where you are facing the issue?

You can use like below WildMatch(Dummyworklists.worklist,'ABCD','EFG','HIJK')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
viveksairam89
Creator
Creator
Author

Thanks for the reply Anil

But it should be dynamic where we should be able to load from excel , i have given a example using Inline function,what is there in my excel

Load*Inline[

DummyWorklists,category

ABCD,A

EFG,A

HIJK,A

LRTY,B

];

Anil_Babu_Samineni

Here, you have to write

Load * Inline [

DummyWorklists,category

ABCD,A

EFG,A

HIJK,A

LRTY,B

] where WildMatch(DummyWorklists,'ABCD','EFG','HIJK');

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
viveksairam89
Creator
Creator
Author

Instead of using wild match i can directly put Where clause category ='A', it will bring all related category to A,

My question is They have already script of Select statement in that they have use IN Function and hard coded the dummyworklists,Now they want to remove the hard coded

Dummyworklists.worklist IN ('ABCD',

                                                       'EFG',

                                                       'HIJK');


and they want to introduce the excel that i have give in inline

I have tried with Apply map,Left join,i didn't got desired output

Anil_Babu_Samineni

When you need only three values of data that means hard coded only. May be try to store variable and then call same in inline memory

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
viveksairam89
Creator
Creator
Author

Just for example i have dummyworklists  name of 3 i have more than 10 values,

can you give some examples how to fix this requirement

Anil_Babu_Samineni

If you don't mine, Can you please explain the business?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
viveksairam89
Creator
Creator
Author

Its just a Enhancement work,Just they have SQL Select statement in the script editor and they were hard coded this Dummyworklists name but now they have provided the source that is excel that is the sample inline statement you can see above i have mentioned above Eralier

Need to remove the hard coded worklist and insert this source and match them only they need the category A

Anil_Babu_Samineni

I don't think so whether we can achieve this in script. The way i follow usually is to create Variable for 10 names and then i can call them up into Condition

May be some one can help you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful