Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
viveksairam89
Contributor

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

Re: SQL Select statement

Where you are facing the issue?

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
viveksairam89
Contributor

Re: SQL Select statement

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

];

Re: SQL Select statement

Here, you have to write

Load * Inline [

DummyWorklists,category

ABCD,A

EFG,A

HIJK,A

LRTY,B

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
viveksairam89
Contributor

Re: SQL Select statement

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

Re: SQL Select statement

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
viveksairam89
Contributor

Re: SQL Select statement

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

Re: SQL Select statement

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
viveksairam89
Contributor

Re: SQL Select statement

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

Re: SQL Select statement

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)