<?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 Qlik Sense IF logic for Conditional Measure with a Drill Down Dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-IF-logic-for-Conditional-Measure-with-a-Drill-Down/m-p/1681517#M51853</link>
    <description>&lt;P&gt;I am attempting to change the way a measure is calculated based on the stage of a drill down. I am able to correctly visualize the data independently.&lt;/P&gt;&lt;P&gt;Level A dimension is defined as:&amp;nbsp;Aggr(Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#]),[Name])&lt;BR /&gt;and the corresponding measure is:&amp;nbsp;Count(Distinct{&amp;lt;[Status]={'OK'}&amp;gt;}[Name])&lt;/P&gt;&lt;P&gt;When visualized as a bar chart, it displays x= number of events; and y=frequency that [Name] had the same number of events (eg. x=11 and y=5: Five Names have Eleven event occurrences).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Level B dimension is defined as: [Name]&lt;BR /&gt;and the corresponding measure is:&amp;nbsp;Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#])&lt;/P&gt;&lt;P&gt;When visualized as a bar chart, it displays x=name; and y=number of events.&lt;/P&gt;&lt;P&gt;My goal is that when the user selects 11, the drill down displays the 5 names and shows the number of events associated with each name.&lt;/P&gt;&lt;P&gt;The following IF statement should work but doesn't. I have tested it by components and it appears to function but fails as a whole. What is the correct approach and more importantly why is this logic failing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count(&lt;BR /&gt;IF(Count({$&amp;lt;[Status]={'OK'}&amp;gt;}[Name])=Count({1&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // IF Current set = Original set&lt;BR /&gt;Count(Distinct{&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // TRUE = Calculate Level A&lt;BR /&gt;Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#])) // FALSE = Calculate Level B&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Result:&lt;BR /&gt;All conditions are evaluated as TRUE regardless of whether the current set is equal to the original set or not.&lt;/P&gt;&lt;P&gt;Test A:&lt;BR /&gt;Count(&lt;BR /&gt;IF(Count({$&amp;lt;[Status]={'OK'}&amp;gt;}[Name])=Count({1&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // IF Current set = Original set&lt;BR /&gt;'Hi Mom', // TRUE = display string Mom&lt;BR /&gt;'Hi Dad' // FALSE = display string Dad&lt;BR /&gt;) // Chart responds as expected, when drill down changes, displays Mom at level A and Dad at level B.&lt;/P&gt;&lt;P&gt;Test B:&lt;BR /&gt;Count(&lt;BR /&gt;IF(P=Q, // IF Current set = Original set&lt;BR /&gt;Count(Distinct{&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // TRUE = Calculate Level A&lt;BR /&gt;Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#])) // FALSE = Calculate Level B&lt;BR /&gt;) // P &amp;amp; Q are numbers, if they are set to be equivalent so that the logic is TRUE,&amp;nbsp;measure calculation equals TRUE;&amp;nbsp;if they are set to be different so that the logic is FALSE,&amp;nbsp;measure calculation equals FALSE&lt;/P&gt;&lt;P&gt;Any thoughts on why this is happening? Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:06:18 GMT</pubDate>
    <dc:creator>epar5lcd</dc:creator>
    <dc:date>2024-11-16T03:06:18Z</dc:date>
    <item>
      <title>Qlik Sense IF logic for Conditional Measure with a Drill Down Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-IF-logic-for-Conditional-Measure-with-a-Drill-Down/m-p/1681517#M51853</link>
      <description>&lt;P&gt;I am attempting to change the way a measure is calculated based on the stage of a drill down. I am able to correctly visualize the data independently.&lt;/P&gt;&lt;P&gt;Level A dimension is defined as:&amp;nbsp;Aggr(Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#]),[Name])&lt;BR /&gt;and the corresponding measure is:&amp;nbsp;Count(Distinct{&amp;lt;[Status]={'OK'}&amp;gt;}[Name])&lt;/P&gt;&lt;P&gt;When visualized as a bar chart, it displays x= number of events; and y=frequency that [Name] had the same number of events (eg. x=11 and y=5: Five Names have Eleven event occurrences).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Level B dimension is defined as: [Name]&lt;BR /&gt;and the corresponding measure is:&amp;nbsp;Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#])&lt;/P&gt;&lt;P&gt;When visualized as a bar chart, it displays x=name; and y=number of events.&lt;/P&gt;&lt;P&gt;My goal is that when the user selects 11, the drill down displays the 5 names and shows the number of events associated with each name.&lt;/P&gt;&lt;P&gt;The following IF statement should work but doesn't. I have tested it by components and it appears to function but fails as a whole. What is the correct approach and more importantly why is this logic failing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count(&lt;BR /&gt;IF(Count({$&amp;lt;[Status]={'OK'}&amp;gt;}[Name])=Count({1&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // IF Current set = Original set&lt;BR /&gt;Count(Distinct{&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // TRUE = Calculate Level A&lt;BR /&gt;Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#])) // FALSE = Calculate Level B&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Result:&lt;BR /&gt;All conditions are evaluated as TRUE regardless of whether the current set is equal to the original set or not.&lt;/P&gt;&lt;P&gt;Test A:&lt;BR /&gt;Count(&lt;BR /&gt;IF(Count({$&amp;lt;[Status]={'OK'}&amp;gt;}[Name])=Count({1&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // IF Current set = Original set&lt;BR /&gt;'Hi Mom', // TRUE = display string Mom&lt;BR /&gt;'Hi Dad' // FALSE = display string Dad&lt;BR /&gt;) // Chart responds as expected, when drill down changes, displays Mom at level A and Dad at level B.&lt;/P&gt;&lt;P&gt;Test B:&lt;BR /&gt;Count(&lt;BR /&gt;IF(P=Q, // IF Current set = Original set&lt;BR /&gt;Count(Distinct{&amp;lt;[Status]={'OK'}&amp;gt;}[Name]), // TRUE = Calculate Level A&lt;BR /&gt;Count({&amp;lt;[Status]={'OK'}&amp;gt;}[Event#])) // FALSE = Calculate Level B&lt;BR /&gt;) // P &amp;amp; Q are numbers, if they are set to be equivalent so that the logic is TRUE,&amp;nbsp;measure calculation equals TRUE;&amp;nbsp;if they are set to be different so that the logic is FALSE,&amp;nbsp;measure calculation equals FALSE&lt;/P&gt;&lt;P&gt;Any thoughts on why this is happening? Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:06:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Sense-IF-logic-for-Conditional-Measure-with-a-Drill-Down/m-p/1681517#M51853</guid>
      <dc:creator>epar5lcd</dc:creator>
      <dc:date>2024-11-16T03:06:18Z</dc:date>
    </item>
  </channel>
</rss>

