Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Contributor

Problems with using two similar datasets in Qlikview

Hi!

I want to use two different datasets in Qlikview - that have the same variable names and the difference between the datasets are, that they are compiled at different times of the year (one time a year and daily). I want to create a sheet in a Qlikview application where I show tables and graphs compiled at one time and another sheet with (almost) the same tables and graphs compiled at the other time.

First I tried to rename the variables in the original daily data set with variableName_daily, so that I knew the difference between the variables from the yearly and the daily data sets.

This worked fine! But then I wanted to make the layout more nice to look at. I wanted to transform the renamed variables in the script using as [ ] function. In the [] I have named the daily variables the same as I have names the yearly data. When I reload I get this error below.

Can't I somehow get the variable names from the two different datasets to appear the same, although the have different initial values (some with _daily on)??

Kind Regards Maria

error.png

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Problems with using two similar datasets in Qlikview

I think you forgot the comma the "as" and  "," after the last two fields..

...

fakultet_dd  AS<-- [Fakultet ],<--

     aar_dd as [År ],<--

     person_id

View solution in original post

9 Replies
Highlighted
Honored Contributor III

Re: Problems with using two similar datasets in Qlikview

Maria i am unable see the pop up box clearly.

can you please write up the text of it ?

Highlighted
Valued Contributor II

Re: Problems with using two similar datasets in Qlikview

You ned to post a bigger screengrab so it's able to be read.

Highlighted
Contributor

Re: Problems with using two similar datasets in Qlikview

This is kopied text:

Syntax error, missing/misplaced FROM:

STAA_IDAG_DD:

LOAD rsj_besldato_dd,

     rsj_anledning_dd,

     rsj_sted_id_dd,

     stud_uddramme_id_dd,

     RETRES_KARAKTER_dd,

     bedodato_dd,

     korselsdato_dd,

     STUDIERETNING_dd as [Studieretning ],

     EKA_NAVN_dd as [Aktivitetsnavn ],

     BELASTNING_dd,

     ADMENHED_dd as [Adm. enhed ],

     TEORI_PRAKTIK_dd,

     EKA_aktgrp_dd,

     aarugenr_dd,

     ugenr_dd as [Ugenummer ],

     STAA_dd as [STÅ ],

     fakultet_dd [Fakultet ]

     aar_dd as [År ]

     person_id

FROM

(ooxml, embedded labels, table is STAA_IDAG_DD)

STAA_IDAG_DD:

LOAD rsj_besldato_dd,

     rsj_anledning_dd,

     rsj_sted_id_dd,

     stud_uddramme_id_dd,

     RETRES_KARAKTER_dd,

     bedodato_dd,

     korselsdato_dd,

     STUDIERETNING_dd as [Studieretning ],

     EKA_NAVN_dd as [Aktivitetsnavn ],

     BELASTNING_dd,

     ADMENHED_dd as [Adm. enhed ],

     TEORI_PRAKTIK_dd,

     EKA_aktgrp_dd,

     aarugenr_dd,

     ugenr_dd as [Ugenummer ],

     STAA_dd as [STÅ ],

     fakultet_dd [Fakultet ]

     aar_dd as [År ]

     person_id

FROM

(ooxml, embedded labels, table is STAA_IDAG_DD)

Highlighted
Honored Contributor III

Re: Problems with using two similar datasets in Qlikview

james is right

Highlighted
Not applicable

Re: Problems with using two similar datasets in Qlikview

I think you forgot the comma the "as" and  "," after the last two fields..

...

fakultet_dd  AS<-- [Fakultet ],<--

     aar_dd as [År ],<--

     person_id

View solution in original post

Highlighted
Valued Contributor III

Re: Problems with using two similar datasets in Qlikview

Maria,

it looks like you're missing a semicolon after your first load statement.

Marcus

Highlighted
Contributor

Re: Problems with using two similar datasets in Qlikview

Now I don't get the error message - but it seems like I am not able to work with two data sets that have the same variable indication. I can see the numbers in the two tables I make (which should have different values) have the same values - so somehow Qlikview can't recognise if the variables comes from the one or the other data set..
The tables below should show not show the same values:

tables.png

Highlighted
Valued Contributor II

Re: Problems with using two similar datasets in Qlikview

I dont Know Wht u r looking but by seeing ur script these things are missing comma and semicolon

Table1:

fakultet_dd as [Fakultet ],

     aar_dd as [År ],

     person_id

FROM

(ooxml, embedded labels, table is STAA_IDAG_DD);

Table2:

fakultet_dd as  [Fakultet ],

     aar_dd as [År ],

     person_id

FROM

(ooxml, embedded labels, table is STAA_IDAG_DD);

Highlighted
Contributor

Re: Problems with using two similar datasets in Qlikview

I have corrected the script now - see below. But I still cant get Qlikview to show different pivot tables with

- yearly data: variables fakultet and aar

versus

- daily data: variables fakultet_dd and aar_dd

SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='kr. #.##0,00;kr. -#.##0,00';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD-MM-YYYY';
SET TimestampFormat='DD-MM-YYYY hh:mm:ss[.fff]';
SET MonthNames='jan;feb;mar;apr;maj;jun;jul;aug;sep;okt;nov;dec';
SET DayNames='ma;ti;on;to;fr;lø;sø';

STAA_KUM:
LOAD PERSON_ID,
    
rsj_besldato,
    
rsj_anledning,
    
rsj_lbnr,
    
rsj_ress_staa,
    
rsj_res_id,
    
rsj_sted_id,
    
stud_uddramme_id,
    
rsj_uddelement_id,
    
RETRES_KARAKTER,
    
bedodato,
    
staa_id,
    
korselsdato,
    
STUDIEORDN_ID,
    
STORDKOD,
    
STUDIERETNING as Studieretning,
    
EKA_KODE,
    
EKA_NAVN as Aktivitetsnavn,
    
BELASTNING,
    
ADMENHED as [Adm. enhed],
    
TEORI_PRAKTIK,
    
EKA_aktgrp,
    
aarugenr as Ugenummer,
    
ugenr,
    
STAA as [STÅ],
    
fakultet as Fakultet,
    
aar as [År]
FROM
[QV filer til STAA\STAA_KOMMULERET.QVD]
(
qvd);

STAA_IDAG_DD:
LOAD rsj_besldato_dd,
    
rsj_anledning_dd,
    
rsj_sted_id_dd,
    
stud_uddramme_id_dd,
    
RETRES_KARAKTER_dd,
    
bedodato_dd,
    
korselsdato_dd,
    
STUDIERETNING_dd as [Studieretning ],
    
EKA_NAVN_dd as [Aktivitetsnavn ],
    
BELASTNING_dd,
    
ADMENHED_dd as [Adm. enhed ],
    
TEORI_PRAKTIK_dd,
    
EKA_aktgrp_dd,
    
aarugenr_dd,
    
ugenr_dd as [Ugenummer ],
    
STAA_dd as [STÅ ],
    
fakultet_dd as [Fakultet ],
    
aar_dd as [År ],
    
person_id
FROM

(
ooxml, embedded labels, table is STAA_IDAG_DD);