Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: 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')

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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
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');

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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
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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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
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?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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
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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)