<?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 Expression help ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179842#M46516</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Hi&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Thanks for your replies.&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;I am still bit confusing. There's NO field available for VAT. So i have loaded data like this:&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; [BOOKING_DATE],&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;Year([BOOKING_DATE]) &lt;B&gt;as&lt;/B&gt; year,&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;`GROSS_SALES`;&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; `BOOKING_DATE`,&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;`GROSS_SALES`&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;FROM&lt;/B&gt; A;&lt;/P&gt;&lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;VAT:&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;INLINE&lt;/B&gt; [&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;year Vat&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2004, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2005, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2006, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2007, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2008, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2009, 15.0&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2010, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2011, 20.0&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;;&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Now i got 'Vat' dimension. If i click year 2011, it will show the associative value 20.0 in Vat. But VAT has chaged on 04&lt;SUP&gt;th&lt;/SUP&gt; Jan 2011 ( 'VAT details' given above). From 1&lt;SUP&gt;st&lt;/SUP&gt; Jan 2011 to 3&lt;SUP&gt;rd&lt;/SUP&gt; jan2011, it was 17.5%. So If i click 01/01/2011 in BOOKING_DATE that should show 17.5 in vat. How can I manipulate this …based on BOOKING_DATE ?&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Mar 2011 15:16:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-25T15:16:40Z</dc:date>
    <item>
      <title>Expression help ?</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179839#M46513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I need to calculate NET SALES based on VAT rate. But VAT is changing year to year on a particular date. Net sales = Gross sales - VAT.&lt;/P&gt;&lt;P&gt;Only 'Gross Sales' field available in database. So I have created a YEAR dimension extracted from DATE field. YEAR values are 2004 , 2005,… 2011.&lt;/P&gt;&lt;P&gt;VAT details:&lt;/P&gt;&lt;P&gt;Year VAT% With effect from&lt;/P&gt;&lt;P&gt;2011 &lt;B style="mso-bidi-font-weight: normal;"&gt;20%&lt;/B&gt; 04/01/2011&lt;/P&gt;&lt;P&gt;2010 &lt;B style="mso-bidi-font-weight: normal;"&gt;17.5%&lt;/B&gt; 01/01/2010&lt;/P&gt;&lt;P&gt;2009 &lt;B style="mso-bidi-font-weight: normal;"&gt;15.0%&lt;/B&gt; 01/12/2008&lt;/P&gt;&lt;P&gt;2008 &lt;B style="mso-bidi-font-weight: normal;"&gt;17.5%&lt;/B&gt; -------------&lt;/P&gt;&lt;P&gt;2007 &lt;B style="mso-bidi-font-weight: normal;"&gt;17.5%&lt;/B&gt; -------------&lt;/P&gt;&lt;P&gt;2006 &lt;B style="mso-bidi-font-weight: normal;"&gt;17.5%&lt;/B&gt; -------------&lt;/P&gt;&lt;P&gt;2005 &lt;B style="mso-bidi-font-weight: normal;"&gt;17.5%&lt;/B&gt; -------------&lt;/P&gt;&lt;P&gt;2004 &lt;B style="mso-bidi-font-weight: normal;"&gt;17.5%&lt;/B&gt; -------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I click year 2011…that should show the 'Net sales' based on VAT rates 20% and 17.5% .. because VAT has changed on 04&lt;SUP&gt;th&lt;/SUP&gt; Jan 2011. Before that, it was 17.5%&lt;/P&gt;&lt;P&gt;Can someone tell me the code to write in expression ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179839#M46513</guid>
      <dc:creator />
      <dc:date>2011-03-24T16:04:25Z</dc:date>
    </item>
    <item>
      <title>Expression help ?</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179840#M46514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression itself will be really simple, you just need to implement this properly in your data model. I'm assuming you have a calendar dimension with years in it. Do a LEFT JOIN onto that table to bring in VAT%. Because of QV's associate data model, each sales transaction will then be associated with a particular VAT% because it is associated with a date. Your expression would then be simply: (1-VAT)*sum(Sales)&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179840#M46514</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-03-24T16:22:06Z</dc:date>
    </item>
    <item>
      <title>Expression help ?</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179841#M46515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;If your sales transactions table is related to your calendar, then the associative logic should do the rest. Using the following should work regardless of the year selected, if any:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum(Gross * VAT)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In case VAT is a percentage.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:22:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179841#M46515</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-03-24T16:22:16Z</dc:date>
    </item>
    <item>
      <title>Expression help ?</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179842#M46516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Hi&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Thanks for your replies.&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;I am still bit confusing. There's NO field available for VAT. So i have loaded data like this:&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; [BOOKING_DATE],&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;Year([BOOKING_DATE]) &lt;B&gt;as&lt;/B&gt; year,&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;`GROSS_SALES`;&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; `BOOKING_DATE`,&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;`GROSS_SALES`&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;FROM&lt;/B&gt; A;&lt;/P&gt;&lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-style: italic; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;VAT:&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;INLINE&lt;/B&gt; [&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;year Vat&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2004, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2005, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2006, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2007, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2008, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2009, 15.0&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2010, 17.5&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;2011, 20.0&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;;&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Now i got 'Vat' dimension. If i click year 2011, it will show the associative value 20.0 in Vat. But VAT has chaged on 04&lt;SUP&gt;th&lt;/SUP&gt; Jan 2011 ( 'VAT details' given above). From 1&lt;SUP&gt;st&lt;/SUP&gt; Jan 2011 to 3&lt;SUP&gt;rd&lt;/SUP&gt; jan2011, it was 17.5%. So If i click 01/01/2011 in BOOKING_DATE that should show 17.5 in vat. How can I manipulate this …based on BOOKING_DATE ?&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;&lt;/P&gt;&lt;P style="line-height:normal;margin:0cm 0cm 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 15:16:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179842#M46516</guid>
      <dc:creator />
      <dc:date>2011-03-25T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Expression help ?</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179843#M46517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to join VAT on Booking Date, not on year. Unless you're very patient, I doubt you can do this with an inline load. Rather create a table with the following fields: BeginDate, EndDate, VAT. Then you can do either an intervalmatch using this table (see help file for more details) or simply a join as follows:&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;data:&lt;BR /&gt;LOAD&lt;BR /&gt; [BOOKING_DATE],&lt;BR /&gt; Year([BOOKING_DATE]) as year,&lt;BR /&gt; `GROSS_SALES`;&lt;BR /&gt;SQL SELECT `BOOKING_DATE`,&lt;BR /&gt;`GROSS_SALES`&lt;BR /&gt;FROM A;&lt;BR /&gt;VAT_table:&lt;BR /&gt;LOAD&lt;BR /&gt; BeginDate,&lt;BR /&gt; EndDate,&lt;BR /&gt; VAT&lt;BR /&gt;FROM myfile.qvd (qvd);&lt;BR /&gt;JOIN (VAT_table) LOAD [BOOKING_DATE] RESIDENT data;&lt;BR /&gt;final_VAT_table:&lt;BR /&gt;LOAD&lt;BR /&gt; [BOOKING_DATE],&lt;BR /&gt; VAT&lt;BR /&gt;RESIDENT VAT_table&lt;BR /&gt;WHERE [BOOKING_DATE]&amp;gt;=BeginDate and [BOOKING_DATE]&amp;lt;=EndDate&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE VAT_table;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 17:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179843#M46517</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-03-25T17:07:01Z</dc:date>
    </item>
    <item>
      <title>Expression help ?</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179844#M46518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Vlad!&lt;/P&gt;&lt;P&gt;Your solution working fine for me...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 09:04:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-help/m-p/179844#M46518</guid>
      <dc:creator />
      <dc:date>2011-04-01T09:04:42Z</dc:date>
    </item>
  </channel>
</rss>

