Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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);
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....
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);
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);