<?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>topic Re: Do multiple operations in one single expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111542#M893311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;very sorry, I have edited the post. Initial and end dates are the dates user selects, that is, user selects one initial date and one final date. Then data is filtered between this two dates, and the result (end date - initial date) should be in days.&lt;/P&gt;&lt;P&gt;Very sorry for not to be clear initialy, now I have explained it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Aug 2016 20:01:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-15T20:01:28Z</dc:date>
    <item>
      <title>Do multiple operations in one single expression</title>
      <link>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111539#M893308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table that I have loaded initialy in my script. Now I have a text object and I would like to assign it an expression based on the calculation from some table fields. I have a field that represents the type of hardware equipment and I have another field that represents its costs. something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HW Equipment&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 550 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Z8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1200&amp;nbsp; €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 650 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 400 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Z8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 250 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; V3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; V3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 €&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to calculate the following for each equipment between two dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (end date - initial date) / number of failures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note that:&lt;/P&gt;&lt;P&gt;1) end date - initial date corresponds to the user selection, she/he selects two dates, initial and final, and once selected, data is selected between these dates [initial date, end date] in days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) number of failures in this case is the same as the number of records, for example, for A1 is 3, B3 is 1, Z8 is 2, V3 is 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally once I have calculated the above expression for each equipment I would like to sum all them and divide between the number of equipments, in this case 4 equipments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I want to assign this final calculation to one text object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how can I calculate the expression for this text object but without using scripts? How can I do it using an expression? Is it possible to iterate for each equipment, do the calculation for each of them, then sum all them and finally divide between the number of equipments in one single expression? I am not sure if i can do an iteration in an expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111539#M893308</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Do multiple operations in one single expression</title>
      <link>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111540#M893309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;sum(aggr(count([HW Equipment]), [HW Equipment]))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;count(DISTINCT [HW Equipment])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9 &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;/ &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;4 &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 19:50:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111540#M893309</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-08-15T19:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Do multiple operations in one single expression</title>
      <link>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111541#M893310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You somewhere lost me when talking about start and end dates and showing equipment and cost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use advanced aggregation to get what you want, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( Aggr( (Max(EndDate) - Min(InitialDate)&amp;nbsp; ) / Count(HWEquipment), HWEquipment))&lt;/P&gt;&lt;P&gt;/ Count(DISTINCT HWEquipment)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2967"&gt;AGGR...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4418"&gt;Pitfalls of the Aggr function&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 19:54:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111541#M893310</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-08-15T19:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Do multiple operations in one single expression</title>
      <link>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111542#M893311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;very sorry, I have edited the post. Initial and end dates are the dates user selects, that is, user selects one initial date and one final date. Then data is filtered between this two dates, and the result (end date - initial date) should be in days.&lt;/P&gt;&lt;P&gt;Very sorry for not to be clear initialy, now I have explained it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 20:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-multiple-operations-in-one-single-expression/m-p/1111542#M893311</guid>
      <dc:creator />
      <dc:date>2016-08-15T20:01:28Z</dc:date>
    </item>
  </channel>
</rss>

