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: 
shanmurugesh
Partner - Contributor II
Partner - Contributor II

Load data from multiple table which is having common fields

Hi all,

I'm facing one challenging problem while making data model.

the scenario is...

In our database, PLC system will store all the parameters of machine as one table for every day.

ie one new table will be created on 01/04/2016 as MAC_PARAM_010416,similarly for each day system will create one new table as MAC_PARAM_(DATE).

Now i needs to load the data from these table in to qvd on daily basis , with the simple script.

Hope you guys can give ideas.

Thanks and regards,

Murugesan.

1 Solution

Accepted Solutions
perumal_41
Partner - Specialist II
Partner - Specialist II

use like  below

Let vToday=Date(today-1,'DDMMYY'

MAC_PARAM_$(vToday):

Load * From MAC_PARAM_$(vToday);


Store MAC_PARAM_$(vToday) into MAC_PARAM_$(vToday).qvd;

Drop table MAC_PARAM_$(vToday)

View solution in original post

8 Replies
perumal_41
Partner - Specialist II
Partner - Specialist II

use like  below

Let vToday=Date(today-1,'DDMMYY'

MAC_PARAM_$(vToday):

Load * From MAC_PARAM_$(vToday);


Store MAC_PARAM_$(vToday) into MAC_PARAM_$(vToday).qvd;

Drop table MAC_PARAM_$(vToday)

maxgro
MVP
MVP

read and store in qvd 1 year of files in loop

FOR i=0 to -365 step -1

  LET vDate = Date(Today() +i, 'DDMMYY');

  trace $(vDate);

  // change with your file name

  SourceTable:

  load * from .......;                                                  // use vDate variable

  store * from SourceTable into .......qvd (qvd);      //  "

NEXT

read all your 2016 files with wildcard (* ?)

LOAD *  from MAC_PARAM_????16.csv;

shanmurugesh
Partner - Contributor II
Partner - Contributor II
Author

Hi Massimo,

thanks ..it is working fine.

I have one more scenario like this..hope u can give some idea

there are few tables are newly generated in each day with some predefined prefix in my database.

ie, new tables are created in the name of "AVAIL_XXXXX"

in that XXXXX may be any in name..

in our previous scenario we have date filed in the tablename to filter our tables.

but in this current scenario, how can i identify which are all the tables are not loaded to my qvd??

thank you.

perumal_41
Partner - Specialist II
Partner - Specialist II

try like below ,may be help to you

AVAIL:

Load * From AVAIL_*;


Store AVAIL into AVAIL.qvd;

Drop table AVAIL

shanmurugesh
Partner - Contributor II
Partner - Contributor II
Author

it is working fine, but on the next day i should only load which are all the tables are not loaded in the previous day, how can i identify those tables from database?

is there any option to check with directory??

thank you

perumal_41
Partner - Specialist II
Partner - Specialist II

Yes. is possible .

Let me know what is your type (excel,notepad,xml)?

MarcoWedel

please close your thread if your initial question is answered:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco

sudhir0538
Creator
Creator

Hello Marco Great job really very helpful.

Can u just check this and see if you can help me out ! Badly needs support.

Compare with Old Data