<?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: Date Format based on Variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Date-Format-based-on-Variable/m-p/1682074#M51932</link>
    <description>&lt;P&gt;Scratch that, just solved it ... it was pretty easy. Sorry all. It was just a matter of setting the KPI &lt;STRONG&gt;Number fomatting&lt;/STRONG&gt; option to &lt;STRONG&gt;Measure expression&lt;/STRONG&gt;. Then the expression was:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if (vButton = 1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DATE($(DateFormat), 'MMM-DD hh:mm:ss'),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DATE($(DateFormat), 'DD hh:mm:ss'))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't mind me, I'll see myself out lol&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 13:56:55 GMT</pubDate>
    <dc:creator>PetitFoulard</dc:creator>
    <dc:date>2020-03-05T13:56:55Z</dc:date>
    <item>
      <title>Date Format based on Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Format-based-on-Variable/m-p/1682071#M51931</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;A quick question on dates and variable dates ...&lt;/P&gt;&lt;P&gt;I have, on my dashboard, a Variable Input with two buttons. The two buttons will switch a value between 0 or 1, respectively.&lt;/P&gt;&lt;P&gt;I also have a KPI chart, which displays a date. The only thing is, if the value in my Variable Input is set to 1, I'd like the date format to be "MMM DD hh:mm:ss". And if the Variable Input is set to 0, I'd like the date format to be "DD hh:mm:ss".&lt;/P&gt;&lt;P&gt;In my KPI expression, I have tried something like:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;If (vButton = 1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;vDateFormat = DateFormat(MMM DD hh:mm:ss),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;vDateFormat = DateFormat(DD hh:mm:ss))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;vDateFormat&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But it does not seem to work ...&lt;BR /&gt;I have also tried defining a new date format in my data load editor, and calling that instead.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;If (vButton = 1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;vDateFormat = DateDisplay1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;vDateFormat = DateDisplay2)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;vDateFormat&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;No luck there either. Does anyone know how to accomplish this? It seems like it should be pretty easy, but I have not been able to locate anything online so far.&lt;/P&gt;&lt;P&gt;Cheers and thanks for any assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Format-based-on-Variable/m-p/1682071#M51931</guid>
      <dc:creator>PetitFoulard</dc:creator>
      <dc:date>2024-11-16T03:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format based on Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Format-based-on-Variable/m-p/1682074#M51932</link>
      <description>&lt;P&gt;Scratch that, just solved it ... it was pretty easy. Sorry all. It was just a matter of setting the KPI &lt;STRONG&gt;Number fomatting&lt;/STRONG&gt; option to &lt;STRONG&gt;Measure expression&lt;/STRONG&gt;. Then the expression was:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if (vButton = 1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DATE($(DateFormat), 'MMM-DD hh:mm:ss'),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DATE($(DateFormat), 'DD hh:mm:ss'))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't mind me, I'll see myself out lol&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 13:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Format-based-on-Variable/m-p/1682074#M51932</guid>
      <dc:creator>PetitFoulard</dc:creator>
      <dc:date>2020-03-05T13:56:55Z</dc:date>
    </item>
  </channel>
</rss>

