<?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 Call-Out in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520757#M37282</link>
    <description>&lt;PRE&gt;//Create a mapping table
EventMap:
Mapping
Load * Inline [
EventDate,EventCount
01/01/2017,1
02/14/2018,1
03/15/2017,1
11/06/2016,1
];

//The use a preceding load to lookup the events 
Load *,
ApplyMap('EventMap',TransactionDate,0) as EventCounter;
SQL
select
TO_CHAR(po.created_date, 'MM-DD-YYYY'),
es.last_updated_date,
e.event_code AS EVENTCODE,
e.event_date,
a.agency_code,
bt.buyer_type_code,
bt.description AS buyer_type_desc,
c.channel_code,
c.description AS channel_desc,
ps.price_scale_code,
ps.description AS price_scale_desc,
es.price,
sec.section_code,
s.row_,
s.seat_number,
COUNT(1) AS QTY

from
agency a,
buyer_type bt,
channel c,
event e,
event_category ec,
event_seat es,
order_line_item oli,
patron_order po,
price_scale ps,
seat s,
section sec

where
oli.order_id = po.order_id
and oli.usage_event_id = e.event_id
and es.event_id = e.event_id
and es.order_id = po.order_id
and es.order_line_item_id = oli.order_line_item_id
and po.created_by_agency_id = a.agency_id
and a.channel_id = c.channel_id
and e.event_category_id = ec.event_category_id
and sec.section_id = es.section_id
and s.seat_id = es.seat_id
and es.buyer_type_id = bt.buyer_type_id
and ps.price_scale_id = es.price_scale_id

and trunc(po.created_date) &amp;gt;= ('01-JAN-2018')
and trunc(po.created_date) &amp;lt;= ('08-APR-2019')
and oli.market_type_code = 'P'
and oli.transaction_type_code in ( 'SA', 'ES', 'CS' ) -- sale, claimsale or exchangesale
and c.channel_code in ( 'BOXOFF', 'INTERNET', 'PHONE' )
and ec.event_category_code = 'TYPE'
and e.event_id &amp;gt;= '5039' and e.event_id &amp;lt;= '5079'

GROUP BY
po.created_date,
es.last_updated_date,
e.event_code,
e.event_date,
a.agency_code,
bt.buyer_type_code,
bt.description,
c.channel_code,
c.description,
ps.price_scale_code,
ps.description,
es.price,
sec.section_code,
s.row_,
s.seat_number;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Dec 2018 22:39:23 GMT</pubDate>
    <dc:creator>chriscammers</dc:creator>
    <dc:date>2018-12-13T22:39:23Z</dc:date>
    <item>
      <title>Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520048#M37177</link>
      <description>&lt;P&gt;I have a chart that uses the dimension of 'Transaction Date' that shows ticket sales (Formatted as MM/DD/YYYY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to call-out dates that were events. For example, there was an event on 10/15/2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;The events all come from another file, that field is called 'Event Date' and is also formatted as 'MM/DD/YYYY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Looking for ideas on how to do this? Would I need to create a mapping table?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:05:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520048#M37177</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-12T20:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520063#M37208</link>
      <description>&lt;P&gt;I think there a couple of ways to accomplish what you are talking about and they depend on what additional requirements you have around events. For example if all you want to do is flag dates as "Having an Event" then a simple mapping table would probably do the trick. If you want to be able to list the events that happened then I would probably link a separate event table to your transaction table, then you could use functions like Concat or first sorted value to show events on a specific day.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 21:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520063#M37208</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2018-12-12T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520077#M37211</link>
      <description>&lt;P&gt;I would like to flag a 'Transaction Date' as having an event.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 21:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520077#M37211</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-12T21:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520528#M37252</link>
      <description>&lt;P&gt;This is my script (the select part anyways) Where and how would I apply a map&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;TO_CHAR(po.created_date, 'MM-DD-YYYY'),&amp;nbsp; ("Transaction Date")&lt;BR /&gt;es.last_updated_date,&lt;BR /&gt;e.event_code AS EVENTCODE,&lt;BR /&gt;e.event_date,&lt;BR /&gt;a.agency_code,&lt;BR /&gt;bt.buyer_type_code,&lt;BR /&gt;bt.description AS buyer_type_desc,&lt;BR /&gt;c.channel_code,&lt;BR /&gt;c.description AS channel_desc,&lt;BR /&gt;ps.price_scale_code,&lt;BR /&gt;ps.description AS price_scale_desc,&lt;BR /&gt;es.price,&lt;BR /&gt;sec.section_code,&lt;BR /&gt;s.row_,&lt;BR /&gt;s.seat_number,&lt;BR /&gt;COUNT(1) AS QTY&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 14:52:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520528#M37252</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-13T14:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520576#M37257</link>
      <description>&lt;P&gt;You'll want to use a mapping table to find the events the way I have it coded the applymap function will return 1 if the transaction date is in the event map and a zero if it is not.&lt;/P&gt;&lt;PRE&gt;//Create a mapping table&lt;BR /&gt;EventMap:
Mapping
Load * Inline [
EventDate,EventCount
01/01/2017,1
02/14/2018,1
03/15/2017,1
11/06/2016,1
];

//The use a preceding load to lookup the events 
Load
ApplyMap('EventMap',TransactionDate,0) as EventCounter,
...
seat_number;
SQL Select...;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2018 15:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520576#M37257</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2018-12-13T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520608#M37262</link>
      <description>&lt;P&gt;I built the map and them am applying to my script, running into a syntax issue, any idea where I am going wrong?&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;TO_CHAR(po.created_date, 'MM-DD-YYYY'),&lt;BR /&gt;ApplyMap('EventMap', (TO_CHAR(po.created_date, 'MM-DD-YYYY'),0))) AS EventCounter,&lt;BR /&gt;es.last_updated_date,&lt;BR /&gt;e.event_code AS EVENTCODE,&lt;BR /&gt;e.event_date,&lt;BR /&gt;a.agency_code,&lt;BR /&gt;bt.buyer_type_code,&lt;BR /&gt;bt.description AS buyer_type_desc,&lt;BR /&gt;c.channel_code,&lt;BR /&gt;c.description AS channel_desc,&lt;BR /&gt;ps.price_scale_code,&lt;BR /&gt;ps.description AS price_scale_desc,&lt;BR /&gt;es.price,&lt;BR /&gt;sec.section_code,&lt;BR /&gt;s.row_,&lt;BR /&gt;s.seat_number,&lt;BR /&gt;COUNT(1) AS QTY&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 16:33:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520608#M37262</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-13T16:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520615#M37263</link>
      <description>&lt;P&gt;you are adding a qlik function into the SQL part of the script. you need to use a preceeding load.&lt;/P&gt;&lt;P&gt;I think the documentation in the help files should give you a good overview.&lt;/P&gt;&lt;P&gt;The basics are you can use the SQL as a source for a qlik "Load" statement and it goes something like this&lt;/P&gt;&lt;PRE&gt;MyTable:
Load
Field1,
Field2,
Applymap('Mapname',TransactionDate) as NewField
Field4; //note the semicolin comes before the "from" this is the end of the preceeding load.
SQL Select * from SomeTable; //this SQL statement serves as the from for the above load&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/preceding-load.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/preceding-load.htm&lt;/A&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;</description>
      <pubDate>Thu, 13 Dec 2018 16:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520615#M37263</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2018-12-13T16:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520626#M37264</link>
      <description>&lt;P&gt;I am sure this is correct, just cannot get it to function on my end&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 17:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520626#M37264</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-13T17:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520628#M37265</link>
      <description>&lt;P&gt;could you post your full sql query? I'll post a sample for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 17:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520628#M37265</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2018-12-13T17:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520676#M37269</link>
      <description>&lt;P&gt;select&lt;BR /&gt;TO_CHAR(po.created_date, 'MM-DD-YYYY'),&lt;BR /&gt;es.last_updated_date,&lt;BR /&gt;e.event_code AS EVENTCODE,&lt;BR /&gt;e.event_date,&lt;BR /&gt;a.agency_code,&lt;BR /&gt;bt.buyer_type_code,&lt;BR /&gt;bt.description AS buyer_type_desc,&lt;BR /&gt;c.channel_code,&lt;BR /&gt;c.description AS channel_desc,&lt;BR /&gt;ps.price_scale_code,&lt;BR /&gt;ps.description AS price_scale_desc,&lt;BR /&gt;es.price,&lt;BR /&gt;sec.section_code,&lt;BR /&gt;s.row_,&lt;BR /&gt;s.seat_number,&lt;BR /&gt;COUNT(1) AS QTY&lt;/P&gt;&lt;P&gt;from&lt;BR /&gt;agency a,&lt;BR /&gt;buyer_type bt,&lt;BR /&gt;channel c,&lt;BR /&gt;event e,&lt;BR /&gt;event_category ec,&lt;BR /&gt;event_seat es,&lt;BR /&gt;order_line_item oli,&lt;BR /&gt;patron_order po,&lt;BR /&gt;price_scale ps,&lt;BR /&gt;seat s,&lt;BR /&gt;section sec&lt;/P&gt;&lt;P&gt;where&lt;BR /&gt;oli.order_id = po.order_id&lt;BR /&gt;and oli.usage_event_id = e.event_id&lt;BR /&gt;and es.event_id = e.event_id&lt;BR /&gt;and es.order_id = po.order_id&lt;BR /&gt;and es.order_line_item_id = oli.order_line_item_id&lt;BR /&gt;and po.created_by_agency_id = a.agency_id&lt;BR /&gt;and a.channel_id = c.channel_id&lt;BR /&gt;and e.event_category_id = ec.event_category_id&lt;BR /&gt;and sec.section_id = es.section_id&lt;BR /&gt;and s.seat_id = es.seat_id&lt;BR /&gt;and es.buyer_type_id = bt.buyer_type_id&lt;BR /&gt;and ps.price_scale_id = es.price_scale_id&lt;/P&gt;&lt;P&gt;and trunc(po.created_date) &amp;gt;= ('01-JAN-2018')&lt;BR /&gt;and trunc(po.created_date) &amp;lt;= ('08-APR-2019')&lt;BR /&gt;and oli.market_type_code = 'P'&lt;BR /&gt;and oli.transaction_type_code in ( 'SA', 'ES', 'CS' ) -- sale, claimsale or exchangesale&lt;BR /&gt;and c.channel_code in ( 'BOXOFF', 'INTERNET', 'PHONE' )&lt;BR /&gt;and ec.event_category_code = 'TYPE'&lt;BR /&gt;and e.event_id &amp;gt;= '5039' and e.event_id &amp;lt;= '5079'&lt;/P&gt;&lt;P&gt;GROUP BY&lt;BR /&gt;po.created_date,&lt;BR /&gt;es.last_updated_date,&lt;BR /&gt;e.event_code,&lt;BR /&gt;e.event_date,&lt;BR /&gt;a.agency_code,&lt;BR /&gt;bt.buyer_type_code,&lt;BR /&gt;bt.description,&lt;BR /&gt;c.channel_code,&lt;BR /&gt;c.description,&lt;BR /&gt;ps.price_scale_code,&lt;BR /&gt;ps.description,&lt;BR /&gt;es.price,&lt;BR /&gt;sec.section_code,&lt;BR /&gt;s.row_,&lt;BR /&gt;s.seat_number;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 18:19:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520676#M37269</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-13T18:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520757#M37282</link>
      <description>&lt;PRE&gt;//Create a mapping table
EventMap:
Mapping
Load * Inline [
EventDate,EventCount
01/01/2017,1
02/14/2018,1
03/15/2017,1
11/06/2016,1
];

//The use a preceding load to lookup the events 
Load *,
ApplyMap('EventMap',TransactionDate,0) as EventCounter;
SQL
select
TO_CHAR(po.created_date, 'MM-DD-YYYY'),
es.last_updated_date,
e.event_code AS EVENTCODE,
e.event_date,
a.agency_code,
bt.buyer_type_code,
bt.description AS buyer_type_desc,
c.channel_code,
c.description AS channel_desc,
ps.price_scale_code,
ps.description AS price_scale_desc,
es.price,
sec.section_code,
s.row_,
s.seat_number,
COUNT(1) AS QTY

from
agency a,
buyer_type bt,
channel c,
event e,
event_category ec,
event_seat es,
order_line_item oli,
patron_order po,
price_scale ps,
seat s,
section sec

where
oli.order_id = po.order_id
and oli.usage_event_id = e.event_id
and es.event_id = e.event_id
and es.order_id = po.order_id
and es.order_line_item_id = oli.order_line_item_id
and po.created_by_agency_id = a.agency_id
and a.channel_id = c.channel_id
and e.event_category_id = ec.event_category_id
and sec.section_id = es.section_id
and s.seat_id = es.seat_id
and es.buyer_type_id = bt.buyer_type_id
and ps.price_scale_id = es.price_scale_id

and trunc(po.created_date) &amp;gt;= ('01-JAN-2018')
and trunc(po.created_date) &amp;lt;= ('08-APR-2019')
and oli.market_type_code = 'P'
and oli.transaction_type_code in ( 'SA', 'ES', 'CS' ) -- sale, claimsale or exchangesale
and c.channel_code in ( 'BOXOFF', 'INTERNET', 'PHONE' )
and ec.event_category_code = 'TYPE'
and e.event_id &amp;gt;= '5039' and e.event_id &amp;lt;= '5079'

GROUP BY
po.created_date,
es.last_updated_date,
e.event_code,
e.event_date,
a.agency_code,
bt.buyer_type_code,
bt.description,
c.channel_code,
c.description,
ps.price_scale_code,
ps.description,
es.price,
sec.section_code,
s.row_,
s.seat_number;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 22:39:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1520757#M37282</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2018-12-13T22:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Date Call-Out</title>
      <link>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1521153#M37321</link>
      <description>&lt;P&gt;Thank you your assistance with this. When I edit the script as you recommended, I get an error of&amp;nbsp; 'map_id not found'&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 16:34:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-Call-Out/m-p/1521153#M37321</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2018-12-14T16:34:18Z</dc:date>
    </item>
  </channel>
</rss>

