Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load table with condition

Hi all, I now have a problem about loading table from existing table with condition.

I have connected Survey Monkey and want to select some fields from the table. For example I would like to chose records which field 'question' includes key words like " postive impacts" or " business outcomes". But I can load the table with condition so I load the whole table first.

The script I wrote for load the table is:

[Mid_Program Participant template]:

LOAD

   respondent_id as [GetResponses.respondent_id],

   answer as [GetResponses.answer],

     question as [GetResponses.question];

SELECT respondent_id,

       question,

       answer

FROM GetResponses

WITH PROPERTIES (

  surveyId= '128081116'

);

Then I worte another script to load these fields to another table and added some new fields,

[Mid_Program Participant]:
When wildmmatch( quesion,'postive impacts') + wildmmatch( quesion,'business outcomes')

LOAD

   [GetResponses.respondent_id],
   [GetResponses.question],
   [GetResponses.question],
    'CLientA' as Mid_ProClient,

     'Leadership' as Online_event,

    'LocationA' as Online_occurance
Resident [Mid_Program Participant template1];

Drop table [Mid_Program Participant template1];

Unfortunatly these scripts did't work, any suggestion?

9 Replies
Thiago_Justen_

Maybe this will help you:

[Mid_Program Participant]

LOAD

  [GetResponses.respondent_id],
  If (WildMatch ('[GetResponses.question]', '*positive impacts*,'*business outcomes*')>0,[GetResponses.question]) as question,

  [GetResponses.question],
    'CLientA' as Mid_ProClient,

    'Leadership' as Online_event,

    'LocationA' as Online_occurance
Resident [Mid_Program Participant template1];

Drop table [Mid_Program Participant template1];

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Anonymous
Not applicable
Author

Hi Thiago, I have tried something below and it worked

[Mid_Program Participant template]:

LOAD

   respondent_id as [GetResponses.respondent_id],

   answer as [GetResponses.answer],

     question as [GetResponses.question];

SELECT respondent_id,

       question,

       answer

FROM GetResponses

WITH PROPERTIES (

  surveyId= '128081116'

);

[Mid_Program Participant]:

LOAD

   [GetResponses.respondent_id] as Mid_PP_ID,

    'CLientA' as Mid_PClient,

    'Leadership' as Mid_PEvent,

    'LocationA' as Mid_POccurance,

   [GetResponses.question] as Mid_PP_Question, 

   [GetResponses.answer] as Mid_PP_Answer

Resident [Mid_Program Participant template]

   Where WildMatch([GetResponses.question],'*Changes at work*') or  WildMatch([GetResponses.question],'*outcome*');

But now I would like to load some data to  [Mid_Program Participant] from another table with the same way, and I use :

[Mid_Program Participant template]:

LOAD

   respondent_id as [GetResponses.respondent_id],

   answer as [GetResponses.answer],

     question as [GetResponses.question];

SELECT respondent_id,

       question,

       answer

FROM GetResponses

WITH PROPERTIES (

  surveyId= '128084936'

);

LOAD

   [GetResponses.respondent_id] as Mid_PP_ID,

    'CLientB' as Mid_PClient,

    'Teamwork' as Mid_PEvent,

    'LocationB' as Mid_POccurance,

    [GetResponses.question] as Mid_PP_Question, 

   [GetResponses.answer] as Mid_PP_Answer

Resident [Mid_Program Participant template]

// filter the rows we need

   Where WildMatch([GetResponses.question],'*Changes at work*') or  WildMatch([GetResponses.question],'*outcome*');

Drop table [Mid_Program Participant template];

There are some mistakes about this part, not sure which part is wrong. Any suggestions?

Thiago_Justen_

Hey there,

Check this out:

// filter the rows we need

  Where [GetResponses.question]=WildMatch([GetResponses.question],'*Changes at *') or [GetResponses.question]=WildMatch([GetResponses.question],'*outcome*');

Drop table [Mid_Program Participant template];

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Thiago_Justen_

Rachel,

Any news about your question? Did you solve the problem?

Cheers

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Anonymous
Not applicable
Author

Thiago, thanks for your suggestion. Yes this problem was solved while I am stuck by another problem.

Thiago_Justen_

So, please close this thread by marking the response that helped you.

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Anonymous
Not applicable
Author

Tks!

pablolabbe
Luminary Alumni
Luminary Alumni

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others

Anonymous
Not applicable
Author

Thanks for reminding me. I have marked 'helpful' and  ' Assumed Answered'. If there was any other steps please tell me, coz I am new to here and still learning to use some functions.