Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello i've used this istruction to load some data in qlikview:
COUNTRIES:
LOAD Country,
Capital,
[Area(km.sq)],
Round(Num#(Trim([Population(mio)]))) as Population,
[Pop. Growth],
Currency,
Inflation,
[Official name of Country]
FROM
$(m_oszSourcesFile)Country1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',');
COUNTRIES:
Concatenate(COUNTRIES)
LOAD Country,
Capital,
[Area(km.sq)],
Round(Num#(Trim([Population(mio)]))) as Population,
[Pop. Growth],
Currency,
Inflation,
[Official name of Country]
FROM
$(m_oszSourcesFile)Country2.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
COUNTRIES:
Concatenate(COUNTRIES)
LOAD Country,
Capital,
[Area(km.sq)],
Round(Num#(Trim([Population(mio)]))) as Population,
[Pop. Growth],
Currency,
Inflation,
[Official name of Country]
FROM
$(m_oszSourcesFile)Country3.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
I need to load the data of three different csv in a single table.
The loading process works but there are 2 data duplicated in the table generated and using the count function to get the total number of rows it returns a number that is the effective total of rows plus 5 elements (2 element is ok but the other three?).
I have manually checked the data.
The csv are comma separated data.
Have i made some mistakes in the load script?
Thanks!
Marco
Ok, your script is more complex. You should have posted that information, so we are able to find the cause of your problem.
Country is a key field (at least to your flags table).
You are doing a count(Country), i.e. a count on a key field, which is not allowed. Do a count distinct instead.
I have used your indication but i have still the same result.
Finally the displayed data are more than the data loaded by the script.
Is it correct?
Marco
Count distinct returns exactly the same number.
Marco
Is it possible that you upload a sample qvw that demonstrate your issue?
edit:
And have you double checked that your csv file with flag / Country information does not introduce these additional records?
Hi!
If you want to be sure that you are loading distinct values you should use function Exists.
For example:
Values:
LOAD Distinct
[Field]
FROM Source1;
Concatenate (Values)
LOAD Distinct
[Field]
FROM Source2
Where not Exists ([Field]);
QlikView Help:
exists(field [ , expression ] )
Determines whether a specific field value exists in a specified field of the data loaded so far. Field is a name or a string expression evaluating to a field name. The field must exist in the data loaded so far by the script. Expr is an expression evaluating to the field value to look for in the specified field. If omitted, the current record’s value in the specified field will be assumed.
It seems like your duplicate rows comes from somewhere else that these 3 CSVs... Check wether the tables associated to COUNTRIES don't have these countries in it with a different case.
As swuehl said, it's probably in the Flags table.
Perhaps the qlikview engine, manipulate the data in memory in some mode, that now i can't understand.
I' ve tried all the methods above mentionned but they don't work.
Can you tell me how many copy of a key are mantained in memory in associative mode?
Thank you
Marco
I have also checked the flags table but the duplicated data aren't present.
Marco
It's really hard to help you with the information present.
No chance to upload your sample file or a sample that demonstrate the issue (I think you just need to create your COUNTRIES table and the table(s) linked to Country field)?