Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to combine in one Document(different sheets -copy-print etc with same field name but diffrent ID

this script help me to know the number of copied pages(data loaded from COPY.qvd-incremental)

another script help me to know the number of printed pages-the difference is from where I load data(PRINT.qvd)
how to combine them in the same document(.qvw) each of them in different Sheet(Copy, Print, etc ID is unique)
...
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

TEMP:
Load  ID,
NAME,
     PAGECOUNT,
     DEVICENAME,
     DATE
From c:\COPY.qvd(QVD);

Max:
load max(ID) as maxID
resident TEMP;
Let  vMax = peek('maxID',0,'Max');
Drop table Max;

ODBC CONNECT TO [DB;DBQ=...] (XUserId is ..., XPassword is ...);
Concatenate
SQL SELECT ID,
NAME,
     PAGECOUNT,
     DEVICENAME,
     DATE
FROM DB."COPY" where ID > '$(vMax)';
Store TEMP into COPY.qvd(QVD);

COPY:
Load
   ID,
NAME,
     DEVICENAME,
     PAGECOUNT,
DATE,
year(DATE) as YEAR,
MONTH(DATE) AS MONTH,
Day(DATE) as DAY,

FROM
(qvd);

---------------------------------------------------------------

TEMP:
Load  ID,
NAME,
     PAGECOUNT,
     DEVICENAME,
     DATE
From c:\PRINT.qvd(QVD);...etc etc etc

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't understand what you're asking. Can you explain in more detail what you want? What do you mean with 'each of them different sheets'?


talk is cheap, supply exceeds demand
Not applicable
Author

I need a document containing several sheets each with reference to pages copied, scanned, printed , etc.

As you can see tables copy , print etc.  have the same structure.

ID,

NAME,

PAGECOUNT,

DEVICENAME,

DATE

I chose to increment the field " ID " because it is a large number of printed records.

Now I have different documents ( .qvw ) for each of them : copy , print, etc ...

My question is: how to combine them into a single document using the ID field for each one (using increment)

Thank You!!!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Add a field to the table that contains the type of document.

Load  ID,

NAME,

     PAGECOUNT,

     DEVICENAME,

     DATE,

     FileBaseName() as DocumentType

From c:\*.qvd(QVD);


After loading the data and having created this new field you can then create bookmarks for each sheet for the different document types and use the OnActivateSheet triggers to apply the appropriate bookmark for the sheet.


talk is cheap, supply exceeds demand