<?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: Create period as dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1606182#M44875</link>
    <description>&lt;P&gt;Sasi,&lt;/P&gt;&lt;P&gt;Very thanks for your knowledge ! It works.&lt;/P&gt;&lt;P&gt;One question :&lt;/P&gt;&lt;P&gt;Now, I set the end date with today().&lt;/P&gt;&lt;P&gt;I would like the user to be able to choose the end date (reference date).&lt;/P&gt;&lt;P&gt;Example: choose 13 march 2019 -&amp;gt; P1M = February 2019 and P1M-1 = February 2018. etc. for PM3, P3M-1, ..., YTD, YTD-1.&lt;/P&gt;&lt;P&gt;What to change in the script?&lt;/P&gt;&lt;P&gt;thank you very much for your help, I'm not very used to the qlik language yet.&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2019 14:59:09 GMT</pubDate>
    <dc:creator>fredericlehner</dc:creator>
    <dc:date>2019-07-25T14:59:09Z</dc:date>
    <item>
      <title>Create period as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603147#M44639</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;This is my code in a dimension in straight tab&lt;/U&gt;:&amp;nbsp;&lt;/P&gt;&lt;P&gt;=if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(), -1)) , 'P1M',&lt;BR /&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(),-3)) and TOREP_COMPLETED_DATE &amp;lt;= MonthEnd(TOREP_COMPLETED_DATE, -1), 'P3M',&lt;BR /&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(),-12)) and TOREP_COMPLETED_DATE &amp;lt;= MonthEnd(TOREP_COMPLETED_DATE, -1), 'P12M',&lt;BR /&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= YearStart(AddYears(Today(), 0)) and [TOREP_COMPLETED_DATE] &amp;lt;= Monthstart(AddMonths(Today(), -1)), 'YTD'))))&lt;/P&gt;&lt;P&gt;&lt;U&gt;My Question&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;Each condition (if) is evaluated according to the result of the previous one. It's right.However, I wish to evaluate each condition from the beginning and without taking into account the previous result in order to have the right amount for each period.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 11:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603147#M44639</guid>
      <dc:creator>fredericlehner</dc:creator>
      <dc:date>2019-07-17T11:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create period as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603162#M44640</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Not a solution to your problem but its another way to get the required output&lt;/P&gt;&lt;P&gt;Creates flags at script level for all these conditions and use them in the chart.&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(), -1)) , 1,0) as 'P1M',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(),-3)) and TOREP_COMPLETED_DATE &amp;lt;= MonthEnd(TOREP_COMPLETED_DATE, -1),1,0) as&amp;nbsp; 'P3M',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;From Table ;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Create a synthetic/Calculated dimension (Value List)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DIM:&lt;/STRONG&gt; ValueList('P1M','P3M','P12M','YTD')&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt; If(ValueList('P1M','P3M','P12M','YTD') ='P1M', Sum(Sales),&lt;/P&gt;&lt;P&gt;&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;if(ValueList('P1M','P3M','P12M','YTD') ='P3M',sum(Sales),&lt;/P&gt;&lt;P&gt;&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;if(ValueList('P1M','P3M','P12M','YTD') ='P12M',sum(Sales),&lt;/P&gt;&lt;P&gt;&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;if(ValueList('P1M','P3M','P12M','YTD') ='YTD',sum(Sales)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Sasi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 11:41:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603162#M44640</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2019-07-17T11:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create period as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603389#M44658</link>
      <description>&lt;P&gt;Hi Sasi,&lt;/P&gt;&lt;P&gt;Thanks for this solution.&lt;/P&gt;&lt;P&gt;After created my Tab with the Valuelist and flag on script, all result of each expression are the same result and any difference between flag.&lt;/P&gt;&lt;P&gt;I not understand this case. Can you help me again ?&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:03:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603389#M44658</guid>
      <dc:creator>fredericlehner</dc:creator>
      <dc:date>2019-07-17T21:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create period as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603476#M44667</link>
      <description>&lt;P&gt;My mistake change in expression&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(), -1)) , 1,0) as 'P1M_Flag',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(),-3)) and TOREP_COMPLETED_DATE &amp;lt;= MonthEnd(TOREP_COMPLETED_DATE, -1),1,0) as&amp;nbsp; 'P3M_Flag',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= Monthstart(AddMonths(Today(),-12)) and TOREP_COMPLETED_DATE &amp;lt;= MonthEnd(TOREP_COMPLETED_DATE, -1),1,0) as&amp;nbsp; 'P12M_Flag',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([TOREP_COMPLETED_DATE] &amp;gt;= YearStart(AddYears(Today(), 0)) and [TOREP_COMPLETED_DATE] &amp;lt;= Monthstart(AddMonths(Today(), -1)), 1,0) As 'YTD_Flag'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;From Table ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DIM:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ValueList('P1M','P3M','P12M','YTD')&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If(ValueList('P1M','P3M','P12M','YTD') ='P1M', Sum({&amp;lt;&lt;SPAN&gt;P1M_Flag&lt;/SPAN&gt;={'1'}&amp;gt;}Sales),&lt;/P&gt;&lt;P&gt;&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;if(ValueList('P1M','P3M','P12M','YTD') ='P3M',Sum({&amp;lt;&lt;SPAN&gt;P3M_Flag&lt;/SPAN&gt;={'1'}&amp;gt;}Sales),&lt;/P&gt;&lt;P&gt;&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;if(ValueList('P1M','P3M','P12M','YTD') ='P12M',Sum({&amp;lt;&lt;SPAN&gt;P12M_Flag&lt;/SPAN&gt;={'1'}&amp;gt;}Sales),&lt;/P&gt;&lt;P&gt;&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;if(ValueList('P1M','P3M','P12M','YTD') ='YTD',Sum({&amp;lt;YTD&lt;SPAN&gt;_Flag&lt;/SPAN&gt;={'1'}&amp;gt;}Sales),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Sasi&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 06:29:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1603476#M44667</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2019-07-18T06:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create period as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1604355#M44736</link>
      <description>&lt;P&gt;Very thanks Sasi for your knowledge ! It works.&lt;/P&gt;&lt;P&gt;Now, I set the end date with today().&lt;/P&gt;&lt;P&gt;I would like the user to be able to choose the end date (reference date).&lt;/P&gt;&lt;P&gt;Example: choose 13 march 2019 -&amp;gt; P1M = February 2019 and P1M-1 = February 2018. etc. for PM3, P3M-1, ..., YTD, YTD-1.&lt;/P&gt;&lt;P&gt;What to change in the script?&lt;/P&gt;&lt;P&gt;thank you very much for your help, I'm not very used to the qlik language yet.&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2019 10:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1604355#M44736</guid>
      <dc:creator>fredericlehner</dc:creator>
      <dc:date>2019-07-21T10:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create period as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1606182#M44875</link>
      <description>&lt;P&gt;Sasi,&lt;/P&gt;&lt;P&gt;Very thanks for your knowledge ! It works.&lt;/P&gt;&lt;P&gt;One question :&lt;/P&gt;&lt;P&gt;Now, I set the end date with today().&lt;/P&gt;&lt;P&gt;I would like the user to be able to choose the end date (reference date).&lt;/P&gt;&lt;P&gt;Example: choose 13 march 2019 -&amp;gt; P1M = February 2019 and P1M-1 = February 2018. etc. for PM3, P3M-1, ..., YTD, YTD-1.&lt;/P&gt;&lt;P&gt;What to change in the script?&lt;/P&gt;&lt;P&gt;thank you very much for your help, I'm not very used to the qlik language yet.&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 14:59:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-period-as-dimension/m-p/1606182#M44875</guid>
      <dc:creator>fredericlehner</dc:creator>
      <dc:date>2019-07-25T14:59:09Z</dc:date>
    </item>
  </channel>
</rss>

