Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tips on a simple ERQL query

New Contributor

Re: Tips on a simple ERQL query

Yes, I need a compleately flat csv-file:


Org-Unit                      Operation

Org-unit 1                    Operation 1

Org-Unit 1                   Operation 2

Org-Unit 2                   Opertaion 1


And so forth. See the attaced file, thats my goal. I have tried filddeling with the options you are mentioning (New line, same line and new paragraph) but can't get it right. I always have get one line pr org-unit and all operations on the same line.


Best regards

Trond E


Regular Contributor

Re: Tips on a simple ERQL query

As mentioned, I never tried to construct a csv file like this. It takes me 5 minutes to come up with this script, dirty but fine for the job at hand. Lionel will be sure to be able to help you out with some best practices to use the descriptors for it


oRoot = megaDb()

set colOperation = oRoot.GetCollection("Operation")
For each oOperation in colOperation

set colOrgUnit = oOperation.GetCollection("Org-Unit")

if colOrgUnit.Count > 0 then
for each oOrgUnit in colOrgUnit
print oOperation.GetProp("Short Name") & ";" & oOrgUnit.GetProp("Short Name") & ";"
print oOperation.GetProp("Short Name") & ";;"
end if