<?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 Help with using variables in an Inline load for use with a Pick function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754551#M453722</link>
    <description>&lt;P&gt;How can I create the chart below by using a dimension that takes the user’s chosen “As of Date” value (in this example the user choose an As of Date of 11/1/2020) and then show the first of the month for each month going back 3 months. (My real life scenario will go back 12 months, but using 3 for now in the example.)&amp;nbsp; So in my example, I would need plot 4 to actually be 11/1/2020, 3 to be 10/1/2020, 2 to be 9/1/2020 and 1 to be 8/1/2020.&amp;nbsp; “As of Date” is always a single value so it cannot be used as a dimension like a typical calendar field. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="asofdate.GIF" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/42728iE17DEE9C0443A3B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="asofdate.GIF" alt="asofdate.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create the chart above I used the following in my script&lt;/P&gt;&lt;P&gt;DimDummy:&lt;BR /&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt; * Inline [&lt;BR /&gt;DimDummy&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;And in my chart object as an expression, I then can control each value for each dimension plot 1-4:&lt;/P&gt;&lt;P&gt;=Pick(DimDummy,&lt;BR /&gt;Num([3moback] / [Avg Daily Charges],'#,##0'),&lt;BR /&gt;Num([2moback] / [Avg Daily Charges],'#,##0'),&lt;BR /&gt;Num([1moback] / [Avg Daily Charges],'#,##0'),&lt;BR /&gt;Num([as of selected] / [Avg Daily Charges],'#,##0')&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I cannot seem to make a DimDummy Inline table to reflect the dynamic dates I need.&amp;nbsp; I tried to establish variables (ie, AddMonths(AsOfDate, -2) would represent my plot number 3) and then use the variables in the inline load but it is not working (for starters, I cannot get past the comma in the variable giving me problems even if I try chr(44) in its place).&lt;/P&gt;&lt;P&gt;How would I do this or is there a better way to achieve my chart?&amp;nbsp; Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:45:56 GMT</pubDate>
    <dc:creator>kdmarkee</dc:creator>
    <dc:date>2024-11-15T23:45:56Z</dc:date>
    <item>
      <title>Help with using variables in an Inline load for use with a Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754551#M453722</link>
      <description>&lt;P&gt;How can I create the chart below by using a dimension that takes the user’s chosen “As of Date” value (in this example the user choose an As of Date of 11/1/2020) and then show the first of the month for each month going back 3 months. (My real life scenario will go back 12 months, but using 3 for now in the example.)&amp;nbsp; So in my example, I would need plot 4 to actually be 11/1/2020, 3 to be 10/1/2020, 2 to be 9/1/2020 and 1 to be 8/1/2020.&amp;nbsp; “As of Date” is always a single value so it cannot be used as a dimension like a typical calendar field. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="asofdate.GIF" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/42728iE17DEE9C0443A3B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="asofdate.GIF" alt="asofdate.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create the chart above I used the following in my script&lt;/P&gt;&lt;P&gt;DimDummy:&lt;BR /&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt; * Inline [&lt;BR /&gt;DimDummy&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;And in my chart object as an expression, I then can control each value for each dimension plot 1-4:&lt;/P&gt;&lt;P&gt;=Pick(DimDummy,&lt;BR /&gt;Num([3moback] / [Avg Daily Charges],'#,##0'),&lt;BR /&gt;Num([2moback] / [Avg Daily Charges],'#,##0'),&lt;BR /&gt;Num([1moback] / [Avg Daily Charges],'#,##0'),&lt;BR /&gt;Num([as of selected] / [Avg Daily Charges],'#,##0')&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I cannot seem to make a DimDummy Inline table to reflect the dynamic dates I need.&amp;nbsp; I tried to establish variables (ie, AddMonths(AsOfDate, -2) would represent my plot number 3) and then use the variables in the inline load but it is not working (for starters, I cannot get past the comma in the variable giving me problems even if I try chr(44) in its place).&lt;/P&gt;&lt;P&gt;How would I do this or is there a better way to achieve my chart?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754551#M453722</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2024-11-15T23:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using variables in an Inline load for use with a Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754669#M453725</link>
      <description>&lt;P&gt;Hi try this code :&lt;/P&gt;&lt;P&gt;DataX:&lt;BR /&gt;load * inline [&lt;BR /&gt;Date, Avg Daily Charges&lt;BR /&gt;01-10-2020, 80&lt;BR /&gt;30-09-2020, 63&lt;BR /&gt;29-09-2020, 128&lt;BR /&gt;28-09-2020, 146&lt;BR /&gt;27-09-2020, 70&lt;BR /&gt;26-09-2020, 106&lt;BR /&gt;25-09-2020, 123&lt;BR /&gt;24-09-2020, 90&lt;BR /&gt;23-09-2020, 60&lt;BR /&gt;22-09-2020, 136&lt;BR /&gt;21-09-2020, 57&lt;BR /&gt;20-09-2020, 79&lt;BR /&gt;19-09-2020, 80&lt;BR /&gt;18-09-2020, 94&lt;BR /&gt;17-09-2020, 82&lt;BR /&gt;16-09-2020, 100&lt;BR /&gt;15-09-2020, 80&lt;BR /&gt;14-09-2020, 54&lt;BR /&gt;13-09-2020, 58&lt;BR /&gt;12-09-2020, 56&lt;BR /&gt;11-09-2020, 142&lt;BR /&gt;10-09-2020, 82&lt;BR /&gt;09-09-2020, 61&lt;BR /&gt;08-09-2020, 104&lt;BR /&gt;07-09-2020, 61&lt;BR /&gt;06-09-2020, 66&lt;BR /&gt;05-09-2020, 101&lt;BR /&gt;04-09-2020, 123&lt;BR /&gt;03-09-2020, 125&lt;BR /&gt;02-09-2020, 99&lt;BR /&gt;01-09-2020, 135&lt;BR /&gt;31-08-2020, 84&lt;BR /&gt;30-08-2020, 61&lt;BR /&gt;29-08-2020, 113&lt;BR /&gt;28-08-2020, 97&lt;BR /&gt;27-08-2020, 69&lt;BR /&gt;26-08-2020, 141&lt;BR /&gt;25-08-2020, 77&lt;BR /&gt;24-08-2020, 97&lt;BR /&gt;23-08-2020, 53&lt;BR /&gt;22-08-2020, 60&lt;BR /&gt;21-08-2020, 142&lt;BR /&gt;20-08-2020, 55&lt;BR /&gt;19-08-2020, 65&lt;BR /&gt;18-08-2020, 89&lt;BR /&gt;17-08-2020, 149&lt;BR /&gt;16-08-2020, 68&lt;BR /&gt;15-08-2020, 86&lt;BR /&gt;14-08-2020, 64&lt;BR /&gt;13-08-2020, 131&lt;BR /&gt;12-08-2020, 56&lt;BR /&gt;11-08-2020, 78&lt;BR /&gt;10-08-2020, 94&lt;BR /&gt;09-08-2020, 85&lt;BR /&gt;08-08-2020, 75&lt;BR /&gt;07-08-2020, 67&lt;BR /&gt;06-08-2020, 87&lt;BR /&gt;05-08-2020, 86&lt;BR /&gt;04-08-2020, 114&lt;BR /&gt;03-08-2020, 103&lt;BR /&gt;02-08-2020, 70&lt;BR /&gt;01-08-2020, 85&lt;BR /&gt;31-07-2020, 117&lt;BR /&gt;30-07-2020, 110&lt;BR /&gt;29-07-2020, 117&lt;BR /&gt;28-07-2020, 80&lt;BR /&gt;27-07-2020, 51&lt;BR /&gt;26-07-2020, 79&lt;BR /&gt;25-07-2020, 97&lt;BR /&gt;24-07-2020, 87&lt;BR /&gt;23-07-2020, 91&lt;BR /&gt;22-07-2020, 70&lt;BR /&gt;21-07-2020, 79&lt;BR /&gt;20-07-2020, 129&lt;BR /&gt;19-07-2020, 123&lt;BR /&gt;18-07-2020, 102&lt;BR /&gt;17-07-2020, 74&lt;BR /&gt;16-07-2020, 88&lt;BR /&gt;15-07-2020, 94&lt;BR /&gt;14-07-2020, 66&lt;BR /&gt;13-07-2020, 147&lt;BR /&gt;12-07-2020, 53&lt;BR /&gt;11-07-2020, 110&lt;BR /&gt;10-07-2020, 135&lt;BR /&gt;09-07-2020, 144&lt;BR /&gt;08-07-2020, 125&lt;BR /&gt;07-07-2020, 112&lt;BR /&gt;06-07-2020, 77&lt;BR /&gt;05-07-2020, 108&lt;BR /&gt;04-07-2020, 61&lt;BR /&gt;03-07-2020, 113&lt;BR /&gt;02-07-2020, 86&lt;BR /&gt;01-07-2020, 57&lt;BR /&gt;30-06-2020, 142&lt;BR /&gt;29-06-2020, 109&lt;BR /&gt;28-06-2020, 102&lt;BR /&gt;27-06-2020, 62&lt;BR /&gt;26-06-2020, 117&lt;BR /&gt;25-06-2020, 84&lt;BR /&gt;24-06-2020, 110&lt;BR /&gt;23-06-2020, 132&lt;BR /&gt;22-06-2020, 144&lt;BR /&gt;21-06-2020, 92&lt;BR /&gt;20-06-2020, 53&lt;BR /&gt;19-06-2020, 51&lt;BR /&gt;18-06-2020, 100&lt;BR /&gt;17-06-2020, 55&lt;BR /&gt;16-06-2020, 134&lt;BR /&gt;15-06-2020, 127&lt;BR /&gt;14-06-2020, 143&lt;BR /&gt;13-06-2020, 115&lt;BR /&gt;12-06-2020, 77&lt;BR /&gt;11-06-2020, 72&lt;BR /&gt;10-06-2020, 88&lt;BR /&gt;09-06-2020, 68&lt;BR /&gt;08-06-2020, 115&lt;BR /&gt;07-06-2020, 85&lt;BR /&gt;06-06-2020, 99&lt;BR /&gt;05-06-2020, 63&lt;BR /&gt;04-06-2020, 127&lt;BR /&gt;03-06-2020, 78&lt;BR /&gt;02-06-2020, 141&lt;BR /&gt;01-06-2020, 138&lt;BR /&gt;31-05-2020, 64&lt;BR /&gt;30-05-2020, 140&lt;BR /&gt;29-05-2020, 113&lt;BR /&gt;28-05-2020, 59&lt;BR /&gt;27-05-2020, 126&lt;BR /&gt;26-05-2020, 120&lt;BR /&gt;25-05-2020, 89&lt;BR /&gt;24-05-2020, 118&lt;BR /&gt;23-05-2020, 66&lt;BR /&gt;22-05-2020, 89&lt;BR /&gt;21-05-2020, 120&lt;BR /&gt;20-05-2020, 149&lt;BR /&gt;19-05-2020, 92&lt;BR /&gt;18-05-2020, 55&lt;BR /&gt;17-05-2020, 85&lt;BR /&gt;16-05-2020, 139&lt;BR /&gt;15-05-2020, 102&lt;BR /&gt;14-05-2020, 130&lt;BR /&gt;13-05-2020, 87&lt;BR /&gt;12-05-2020, 82&lt;BR /&gt;11-05-2020, 147&lt;BR /&gt;10-05-2020, 76&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;load&lt;BR /&gt;num(MonthStart(AddMonths(Date,0))) as %_Date,&lt;BR /&gt;num(Date) as Date,&lt;BR /&gt;[Avg Daily Charges]&lt;BR /&gt;Resident DataX;&lt;/P&gt;&lt;P&gt;drop table DataX;&lt;/P&gt;&lt;P&gt;ADC:&lt;BR /&gt;Load&lt;BR /&gt;num(MonthStart(AddMonths(%_Date, 1))) as %_Date,&lt;BR /&gt;1 as Index,&lt;BR /&gt;[Avg Daily Charges] as ADC_1&lt;BR /&gt;Resident Data;&lt;/P&gt;&lt;P&gt;For vMonth = 2 to 4&lt;BR /&gt;left join(ADC)&lt;BR /&gt;Load&lt;BR /&gt;num(MonthStart(AddMonths(%_Date, $(vMonth)))) as %_Date,&lt;BR /&gt;1 as Index,&lt;BR /&gt;[Avg Daily Charges] as ADC_$(vMonth)&lt;BR /&gt;Resident Data&lt;BR /&gt;;&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;an let me know if is what you were looking for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 18:51:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754669#M453725</guid>
      <dc:creator>QFabian</dc:creator>
      <dc:date>2020-10-21T18:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using variables in an Inline load for use with a Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754692#M453726</link>
      <description>&lt;P&gt;That won't work because the calculations are dynamic based on selections and therefore cannot be done in script, which is what I think you are suggesting.&amp;nbsp; I did actually find a rather simple solution by using an IF statement in a calculated dimension which basically builds my labels/plots so I can use my chart expression along with it... like so...&lt;/P&gt;&lt;P&gt;=Date(&lt;BR /&gt;if(DimDummy=1, AsOfDate,&lt;BR /&gt;if(DimDummy=2, AddMonths(AsOfDate, -1),&lt;BR /&gt;if(DimDummy=3, AddMonths(AsOfDate, -2),&lt;BR /&gt;if(DimDummy=4, AddMonths(AsOfDate, -3)&lt;BR /&gt;))))&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 19:47:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-variables-in-an-Inline-load-for-use-with-a-Pick/m-p/1754692#M453726</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2020-10-21T19:47:25Z</dc:date>
    </item>
  </channel>
</rss>

