<?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 SV:Have an issue with my nested if in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325259#M1196102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you are loading the value as a string, you probably need to convert it to a numeric value.&lt;/P&gt;&lt;P&gt;What are you expect 93,0 to represent time wise? 93 minutes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Apr 2011 08:45:56 GMT</pubDate>
    <dc:creator>ToniKautto</dc:creator>
    <dc:date>2011-04-30T08:45:56Z</dc:date>
    <item>
      <title>Have an issue with my nested if</title>
      <link>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325258#M1196101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an issue with my nested if...&lt;BR /&gt;I have a table with a LengthOfTime field. The format of the LengthOfTime data can vary.&lt;BR /&gt;Below are the different variations I have to be able to recognize and format correctly.&lt;BR /&gt;My script runs fine but there is one time format I can't seem to handle - '93,00', don't know why.&lt;BR /&gt;I include a little test qvw i made for this.&lt;/P&gt;&lt;P&gt;LengthOfTime&lt;BR /&gt;------------------------&lt;/P&gt;&lt;P&gt;214&lt;BR /&gt;93,00&lt;BR /&gt;1 min 30 s&lt;BR /&gt;02:34&lt;BR /&gt;00:03:15&lt;BR /&gt;1,15741E-05&lt;BR /&gt;0,000243056&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to disply all below formats like:&lt;BR /&gt;+ only seconds &lt;I&gt;(for making calculations)&lt;/I&gt;&lt;BR /&gt;+ minutes and seconds &lt;I&gt;(only for display to user)&lt;/I&gt;&lt;BR /&gt;+ hh:mm:ss &lt;I&gt;(only for display to user)&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;Code to format the different variations into seconds:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;/* As seconds */&lt;BR /&gt;if(IsNull(LengthOfTime),&lt;BR /&gt;'0',&lt;BR /&gt;if(IsText(Left(LengthOfTime,1)),&lt;BR /&gt;'0',&lt;BR /&gt;if(LengthOfTime = '' or LengthOfTime = ' ',&lt;BR /&gt;'0',&lt;BR /&gt;if(FindOneOf(LengthOfTime, 'min')&amp;gt;0,&lt;BR /&gt;((mid(LengthOfTime,1, Index(LengthOfTime, 'min')-1) * 60) + trim(TextBetween(LengthOfTime, 'min', 's'))),&lt;BR /&gt;if(FindOneOf(LengthOfTime, ':')&amp;gt;0,&lt;BR /&gt;if(SubStringCount(LengthOfTime, ':')=2,(Left(LengthOfTime, 2)*60*60) + (TextBetween(LengthOfTime, ':', ':')*60) + Right(LengthOfTime, 2),(Left(LengthOfTime, 2)*60) + Right(LengthOfTime, 2)),&lt;BR /&gt;if(FindOneOf(LengthOfTime, ',')&amp;gt;0,&lt;BR /&gt;(Left(Time(Replace(LengthOfTime, ',', '.'), 'hh:mm:ss'), 2)*60*60) + (TextBetween(Time(Replace(LengthOfTime, ',', '.'), 'hh:mm:ss'), ':', ':')*60) + Right(Time(Replace(LengthOfTime, ',', '.'), 'hh:mm:ss'), 2),&lt;BR /&gt;floor(LengthOfTime))))))) as tOnlySeconds&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankful for any help with this,&lt;BR /&gt;Johan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Apr 2011 08:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325258#M1196101</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-04-30T08:41:27Z</dc:date>
    </item>
    <item>
      <title>SV:Have an issue with my nested if</title>
      <link>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325259#M1196102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you are loading the value as a string, you probably need to convert it to a numeric value.&lt;/P&gt;&lt;P&gt;What are you expect 93,0 to represent time wise? 93 minutes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Apr 2011 08:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325259#M1196102</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2011-04-30T08:45:56Z</dc:date>
    </item>
    <item>
      <title>SV:Have an issue with my nested if</title>
      <link>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325260#M1196103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;93,00 = 93 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Apr 2011 09:34:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325260#M1196103</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-04-30T09:34:55Z</dc:date>
    </item>
    <item>
      <title>SV:Have an issue with my nested if</title>
      <link>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325261#M1196104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved it !&lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt; /* As seconds */&lt;BR /&gt; if(IsNull(LengthOfTime),&lt;BR /&gt; '0',&lt;BR /&gt;&lt;BR /&gt; if(IsText(Left(LengthOfTime,1)),&lt;BR /&gt; '0',&lt;BR /&gt;&lt;BR /&gt; if(LengthOfTime = '' or LengthOfTime = ' ',&lt;BR /&gt; '0',&lt;BR /&gt;&lt;BR /&gt; if(FindOneOf(LengthOfTime, 'min')&amp;gt;0,&lt;BR /&gt; ((mid(LengthOfTime,1, Index(LengthOfTime, 'min')-1) * 60) + trim(TextBetween(LengthOfTime, 'min', 's'))),&lt;BR /&gt;&lt;BR /&gt; if(FindOneOf(LengthOfTime, ':')&amp;gt;0,&lt;BR /&gt; if(SubStringCount(LengthOfTime, ':')=2,(Left(LengthOfTime, 2)*60*60) + (TextBetween(LengthOfTime, ':', ':')*60) + Right(LengthOfTime, 2),(Left(LengthOfTime, 2)*60) + Right(LengthOfTime, 2)),&lt;BR /&gt;&lt;BR /&gt; if(FindOneOf(LengthOfTime, ',')&amp;gt;0,&lt;BR /&gt; if(Len(LengthOfTime)&amp;gt;6, (Left(Time(Replace(LengthOfTime, ',', '.'), 'hh:mm:ss'), 2)*60*60) + (TextBetween(Time(Replace(LengthOfTime, ',', '.'), 'hh:mm:ss'), ':', ':')*60) + Right(Time(Replace(LengthOfTime, ',', '.'), 'hh:mm:ss'), 2), num(Replace(LengthOfTime, ',', '.'))),&lt;BR /&gt;&lt;BR /&gt; floor(LengthOfTime))))))) as tOnlySeconds,&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Apr 2011 11:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Have-an-issue-with-my-nested-if/m-p/325261#M1196104</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-04-30T11:42:21Z</dc:date>
    </item>
  </channel>
</rss>

