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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Groups

I have three fields in my script, each from different data files / tables:

webPLTFRM (all records are 'Web')

mblPLTFRM (all records are 'Mobile')

appPLTFRM (all records are 'App')

Ultimately, I want to have a list box where the user can select either 'Web' 'Mobile' or 'App'

My tables are already joined by a date field. (DTE) so if I re-name the field above to a common name such as PLTFRM I get an error in my script.

Any suggestions on how to script this better or create this group in my application?

1 Solution

Accepted Solutions
sunny_talwar

If I were you, I would probably concatenate them into one table without renaming them and then use my Flag to differentiate between the three data types:

WEB:

LOAD

     PlatformID,

     Date AS DTE,

     [Monthly Unique Visitors],

     [Total Visitors],

     [Page Views],

     'Web' as Flag

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Mobile:

Concatenate(WEB)

LOAD

     PlatformID,

     Date AS DTE,

     [Monthly Unique Visitors],

     [Total Visitors],

     [Page Views],

     'Mobile' as Flag

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

App:

Concatenate(WEB)

LOAD

     PlatformID,

     Date AS DTE,

     [Monthly Unique Visitors],

     [Total Visitors],

     [Page Views],

     'App' as Flag

FROM(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

View solution in original post

3 Replies
sunny_talwar

May be create a flag for each table:

webPLTFRM :

LOAD YourFields,

           'Web' as Flag

FROM webPLTFRM;


mblPLTFRM:

LOAD YourFields,

           'Mobile' as Flag

FROM mblPLTFRM;


and so on....

evansabres
Specialist
Specialist
Author

This is currently how my script reads. (DTE is the linking field between all three tables) Where would I place the 'Flag'??

WEB:

LOAD

     PlatformID AS webPLTFRM,

     Date AS DTE,

     MONTH(Date) AS MNTH,

     YEAR(Date) AS YEAR,

     [Monthly Unique Visitors] AS webUNQVSTRS,

     [Total Visitors] AS webTTLVSTRS,

     [Page Views] AS webPGVWS

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Mobile:

LOAD

     PlatformID AS mblPLTFRM,

     Date AS DTE,

     [Monthly Unique Visitors] AS mblUNQVSTRS,

     [Total Visitors] AS mblTTLVSTRS,

     [Page Views] AS mblPGVWS

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

App:

LOAD

     PlatformID AS appPLTFRM,

     Date AS DTE,

     [Monthly Unique Visitors] AS appUNQVSTRS,

     [Total Visitors] AS appTTLVSTRS,

     [Page Views] AS appPGVWS

FROM(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

sunny_talwar

If I were you, I would probably concatenate them into one table without renaming them and then use my Flag to differentiate between the three data types:

WEB:

LOAD

     PlatformID,

     Date AS DTE,

     [Monthly Unique Visitors],

     [Total Visitors],

     [Page Views],

     'Web' as Flag

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Mobile:

Concatenate(WEB)

LOAD

     PlatformID,

     Date AS DTE,

     [Monthly Unique Visitors],

     [Total Visitors],

     [Page Views],

     'Mobile' as Flag

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

App:

Concatenate(WEB)

LOAD

     PlatformID,

     Date AS DTE,

     [Monthly Unique Visitors],

     [Total Visitors],

     [Page Views],

     'App' as Flag

FROM(txt, codepage is 1252, embedded labels, delimiter is ',', msq);