<?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: Set the displayed format of a variable and validate variable inputs in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528312#M107524</link>
    <description>&lt;P&gt;The closest thing you can probably get to is to have the Variable Input be set to display as a Drop down and either manually enter or create an expression that will generate list of values that users can select. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="howdash_0-1756130059239.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183123i21A32FCF59F324BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="howdash_0-1756130059239.png" alt="howdash_0-1756130059239.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The users will then be able to select a cost from the list:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="howdash_1-1756130109493.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183124i7F2059A9824055AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="howdash_1-1756130109493.png" alt="howdash_1-1756130109493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's not an ideal user experience, but might work if the amount of values that user should be able to select is limited.&lt;/P&gt;&lt;P&gt;As for the input data type validation, that also isn't available. But, what you can potentially do is &lt;STRONG&gt;have the input box "communicate" to user&lt;/STRONG&gt; when an invalid value is populated.&lt;/P&gt;&lt;P&gt;For example, have the &lt;STRONG&gt;background&lt;/STRONG&gt; of the input box turn &lt;STRONG&gt;red&lt;/STRONG&gt; when a user inputs a value that is not a number and maybe a &lt;STRONG&gt;footer note&lt;/STRONG&gt; telling them to &lt;STRONG&gt;enter a number&lt;/STRONG&gt; instead. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="howdash_2-1756131059080.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183125i7589B1AAEDDA218C/image-size/large?v=v2&amp;amp;px=999" role="button" title="howdash_2-1756131059080.png" alt="howdash_2-1756131059080.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Aug 2025 14:12:47 GMT</pubDate>
    <dc:creator>howdash</dc:creator>
    <dc:date>2025-08-25T14:12:47Z</dc:date>
    <item>
      <title>Set the displayed format of a variable and validate variable inputs</title>
      <link>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528218#M107504</link>
      <description>&lt;P&gt;In Qlik Sense, I have a variable called vCost that I would like to display as currency.&amp;nbsp; In other words, if a user inputs 31, I would like the box to update to read:&lt;/P&gt;&lt;P&gt;$31.00&lt;/P&gt;&lt;P&gt;Is there any way to do that?&lt;/P&gt;&lt;P&gt;Also, is there a way to do validation on a variable input?&amp;nbsp; In other words, if a user put the word 'Amazing' in the vCost input box, I would like the system to reject the input and clear the box.&lt;/P&gt;&lt;P&gt;My thanks for any ideas.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Aug 2025 21:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528218#M107504</guid>
      <dc:creator>timwhite</dc:creator>
      <dc:date>2025-08-23T21:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set the displayed format of a variable and validate variable inputs</title>
      <link>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528219#M107505</link>
      <description>&lt;P&gt;I guess you have another place where the output is.&lt;/P&gt;&lt;P&gt;So just add '$' &amp;amp; $(&lt;SPAN&gt;vCost&amp;nbsp;)&lt;/SPAN&gt; in the output variable in the other box&lt;/P&gt;&lt;P&gt;For Q2 you can use isnum() function so only numerical value will&amp;nbsp; be taken into account and other rejected.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 05:29:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528219#M107505</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2025-08-24T05:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set the displayed format of a variable and validate variable inputs</title>
      <link>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528312#M107524</link>
      <description>&lt;P&gt;The closest thing you can probably get to is to have the Variable Input be set to display as a Drop down and either manually enter or create an expression that will generate list of values that users can select. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="howdash_0-1756130059239.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183123i21A32FCF59F324BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="howdash_0-1756130059239.png" alt="howdash_0-1756130059239.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The users will then be able to select a cost from the list:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="howdash_1-1756130109493.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183124i7F2059A9824055AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="howdash_1-1756130109493.png" alt="howdash_1-1756130109493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's not an ideal user experience, but might work if the amount of values that user should be able to select is limited.&lt;/P&gt;&lt;P&gt;As for the input data type validation, that also isn't available. But, what you can potentially do is &lt;STRONG&gt;have the input box "communicate" to user&lt;/STRONG&gt; when an invalid value is populated.&lt;/P&gt;&lt;P&gt;For example, have the &lt;STRONG&gt;background&lt;/STRONG&gt; of the input box turn &lt;STRONG&gt;red&lt;/STRONG&gt; when a user inputs a value that is not a number and maybe a &lt;STRONG&gt;footer note&lt;/STRONG&gt; telling them to &lt;STRONG&gt;enter a number&lt;/STRONG&gt; instead. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="howdash_2-1756131059080.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183125i7589B1AAEDDA218C/image-size/large?v=v2&amp;amp;px=999" role="button" title="howdash_2-1756131059080.png" alt="howdash_2-1756131059080.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 14:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528312#M107524</guid>
      <dc:creator>howdash</dc:creator>
      <dc:date>2025-08-25T14:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set the displayed format of a variable and validate variable inputs</title>
      <link>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528806#M107610</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/346569"&gt;@timwhite&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without getting in to hacking Sense by injecting JavaScript, I don't think you are going to be able to alter the contents of the variable input box, but you can certainly change it wherever that value is displayed.&lt;/P&gt;&lt;P&gt;Wherever you display the value in the variable, wrap it in a&amp;nbsp;&lt;STRONG&gt;num&lt;/STRONG&gt; function, which formats the value:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=num(vCost, '$#,##0.00')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This will add the dollar sign to the front, add two decimal places and thousand separators (just use&amp;nbsp;&lt;STRONG&gt;$0.00&lt;/STRONG&gt; to not have the separators).&lt;/P&gt;&lt;P&gt;The other good thing about this function is that it returns null if the value passed is not a number. In a chart this will give you a value you can then suppress.&lt;/P&gt;&lt;P&gt;If you want to get rid of the "&lt;STRONG&gt;-"&amp;nbsp;&lt;/STRONG&gt;that appears for nulls you can extend the expression to:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if(isnum(vCost),'',num(vCost, '$#,##0.00'))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 08:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-the-displayed-format-of-a-variable-and-validate-variable/m-p/2528806#M107610</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2025-08-29T08:23:31Z</dc:date>
    </item>
  </channel>
</rss>

