<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Powerdesigner: Create calculated collection based on... in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/powerdesigner-create-calculated-collection-based-on-attribute/qaa-p/13949902#M4894062</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if your goal is just filtering entities (based on Stereotype value) in your report, you don`t need calculated collections at all. You can use filtering options in your report editor. See attached screenshot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Report_filter.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/196065i84FB54328227161E/image-size/large?v=v2&amp;amp;px=999" alt="Report_filter.png" title="Report_filter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you (for whatever reason) still need calculated collection, then your problem is called the scope. If you define your collection at the model level (tab Dependencies in the model properties), you have to browse all your entities present in the model. So the code should look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="vbnet"&gt;Function %Collection%(obj, coll)
  Dim ent
  For each ent in obj.Entities
    coll.Add ent
  Next
  %Collection% = True
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to have this collection available on the Dependencies tab of every entity (i.e. Entity level) you have to define your calculated collection at Entity metaclass level and the code should look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="vbnet"&gt;Function %Collection%(obj, coll)
   Dim ent
   For each ent in obj.Model.Entities
     coll.Add ent
   Next
   %Collection% = True
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps you are looking for the &lt;EM&gt;Stereotype = "Relatie" &lt;/EM&gt;condition. You don`t have to code it at all. You simple filter it on the General page of the Calculated collection. Right under the Target Type dropdown list, there is a Target Stereotype dropdown list. Put your stereotype in there and that`s it.&lt;/P&gt;&lt;P&gt;In case you need some more complex extensions/customizations of PowerDesigner, feel free to contact me on LinkedIn. I`ll be happy to help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ondrej Divis&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2024 11:51:34 GMT</pubDate>
    <dc:creator>Ondrej_Divis</dc:creator>
    <dc:date>2024-11-27T11:51:34Z</dc:date>
    <item>
      <title>Powerdesigner: Create calculated collection based on attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/powerdesigner-create-calculated-collection-based-on-attribute/qaq-p/13947659</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;This seems like kind of a basic question, but I haven't been able to find a whole lot about calculated collections.&lt;/P&gt;&lt;P&gt;I'm trying to create a calculated collection of objects in &lt;LI-PRODUCT title="SAP PowerDesigner" id="01200615320800003658"&gt;&lt;/LI-PRODUCT&gt;, so I can use this pre-filtered set of entities in my report. The problem is: I can't get the syntax right. The best result I've gotten so far (in the report) is a number of lists containing one entity each instead of one list containing every entity. In the dependencies tab, only one entity (the entity whose property window is open) is visible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I used:&lt;/P&gt;&lt;LI-CODE lang="vbnet"&gt;Function %Collection%(obj, coll)
   If obj.GetAttribute("Stereotype") = "Relatie" Then
   coll.Add obj
   End if
   %Collection% = True
   
End Function&lt;/LI-CODE&gt;&lt;P&gt;Can the calculated collection be used as a pre-defined filter for entities (so only entities with the stereotype "Relatie" are in it)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/powerdesigner-create-calculated-collection-based-on-attribute/qaq-p/13947659</guid>
      <dc:creator>RWZI</dc:creator>
      <dc:date>2024-11-25T11:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Powerdesigner: Create calculated collection based on...</title>
      <link>https://community.sap.com/t5/technology-q-a/powerdesigner-create-calculated-collection-based-on-attribute/qaa-p/13949902#M4894062</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if your goal is just filtering entities (based on Stereotype value) in your report, you don`t need calculated collections at all. You can use filtering options in your report editor. See attached screenshot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Report_filter.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/196065i84FB54328227161E/image-size/large?v=v2&amp;amp;px=999" alt="Report_filter.png" title="Report_filter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you (for whatever reason) still need calculated collection, then your problem is called the scope. If you define your collection at the model level (tab Dependencies in the model properties), you have to browse all your entities present in the model. So the code should look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="vbnet"&gt;Function %Collection%(obj, coll)
  Dim ent
  For each ent in obj.Entities
    coll.Add ent
  Next
  %Collection% = True
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to have this collection available on the Dependencies tab of every entity (i.e. Entity level) you have to define your calculated collection at Entity metaclass level and the code should look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="vbnet"&gt;Function %Collection%(obj, coll)
   Dim ent
   For each ent in obj.Model.Entities
     coll.Add ent
   Next
   %Collection% = True
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps you are looking for the &lt;EM&gt;Stereotype = "Relatie" &lt;/EM&gt;condition. You don`t have to code it at all. You simple filter it on the General page of the Calculated collection. Right under the Target Type dropdown list, there is a Target Stereotype dropdown list. Put your stereotype in there and that`s it.&lt;/P&gt;&lt;P&gt;In case you need some more complex extensions/customizations of PowerDesigner, feel free to contact me on LinkedIn. I`ll be happy to help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ondrej Divis&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 11:51:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/powerdesigner-create-calculated-collection-based-on-attribute/qaa-p/13949902#M4894062</guid>
      <dc:creator>Ondrej_Divis</dc:creator>
      <dc:date>2024-11-27T11:51:34Z</dc:date>
    </item>
  </channel>
</rss>

