Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I would like to do something like bwlow:
Country:
LOAD
ABC,
"Country code",
Region
FROM [lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
if ("Region" = AOME)then
Store Country into [lib://Demo/AOME.qvd];
end if
Is it possible?
Best Regards,
Louis
it works after making some changes
SET vQVDPath = 'lib://Demo/Result QVD/';
RegionList:
Load
Region
from
[lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
for i = 1 to FieldValueCount('Region')
Let vCountry = FieldValue('Region',$(i));
LET vFilePath = vQVDPath & vCountry & '.qvd';
Country:
Load
ABC,
"Country code",
Region
FROM [lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where
Region = FieldValue('Region',$(i))
;
Store Country into [$(vFilePath)] (qvd);
Drop table Country;
next
Many Thx!
Hi,
You want to store one QVD by region ?
Not like that. You can do it this way:
Country:
LOAD
ABC,
"Country code",
Region
FROM
[lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
;
AOME:
NOCONCATENATE
LOAD * RESIDENT Country WHERE Region = 'AOME';
STORE AOME INTO [lib://Demo/AOME.qvd];
DROP TABLE AOME;
Try something like this.
RegionList:
Load Region from
[lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
for
i = 1
to
FieldValueCount(
'Region'
)
Country:
Load
ABC,
"Country code",
Region
FROM [lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where
Region = FieldValue(
'Region'
,$(i))
;
Store Country into 'country-'& FieldValue(
'Region'
,$(i))&'.qvd' (qvd);
Drop table Country;
next
I want to store QVD according to the region value.
Example: AOME.QVD, CHINA.QVD, USA.QVD
I would like to store it by using if condition so that i can easily edit if the table structure is changed
and i do not need to change each of them. There are many countries in the region field.
Many Thx!
it works after making some changes
SET vQVDPath = 'lib://Demo/Result QVD/';
RegionList:
Load
Region
from
[lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
for i = 1 to FieldValueCount('Region')
Let vCountry = FieldValue('Region',$(i));
LET vFilePath = vQVDPath & vCountry & '.qvd';
Country:
Load
ABC,
"Country code",
Region
FROM [lib://Demo/Countries.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where
Region = FieldValue('Region',$(i))
;
Store Country into [$(vFilePath)] (qvd);
Drop table Country;
next
Many Thx!
yes it is correct, we can store after load the data only.
Good,
If you've found your solution then please mark the thread as solved. It will help other to find the answer to the same problem in the future and other helpers/experts won't need to pay any more attention to this question.
where can find Countries.csv ?I can't find it, please tell me,thank you!