<?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: Filtering out 0 values from CrossTable() function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511515#M105071</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;And what should I do next? Filter out the non null() values? If that is what you are referring, it doesn't work.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Mar 2025 15:19:01 GMT</pubDate>
    <dc:creator>Stanislav1</dc:creator>
    <dc:date>2025-03-25T15:19:01Z</dc:date>
    <item>
      <title>Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511408#M105046</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following issue, which If I solve I will improve the time efficiency of my app with 30-40%.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I am using a CrossTable() function to seperate the metrics and their corresponding values.&lt;/P&gt;&lt;P&gt;For each metric where there is no value it also creates a row, which makes the size of the final table a problem.&lt;/P&gt;&lt;P&gt;I currently use the following code to remove the Null values, but it makes the transformation time inefficient, because it loads the 0 values and then after that filter them out in the next step.&lt;/P&gt;&lt;P&gt;How can I do both of these steps, creating and filtering the CrossTable into one step. In essence, I want to load everything into CrossTable() but without the 0 values at once. Please check the attached file for the provided function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your convenience, I will add the code here in the chat as well:&lt;/P&gt;&lt;DIV&gt;googleplay.ads_temp: CrossTable('metric','value', 16)&lt;/DIV&gt;&lt;DIV&gt;LOAD&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[#eventDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;, [#installDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , Source&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , event_time&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , install_time&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , event_type&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , package_name&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , device&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , country_code&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , isOrganic&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , ad_network&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , campaign&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , ad_group&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , ad_name&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , App&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , product_line&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; , ads_cost, impressions, clicks&lt;/DIV&gt;&lt;DIV&gt;Resident&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;googleplay.ads_group;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;drop table googleplay.ads_group;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;googleplay.ads: NoConcatenate&lt;/DIV&gt;&lt;DIV&gt;LOAD *&lt;/DIV&gt;&lt;DIV&gt;RESIDENT googleplay.ads_temp&lt;/DIV&gt;&lt;DIV&gt;WHERE value &amp;lt;&amp;gt; 0;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I will highly appreciate your ideas and solutions. If you need any further details, please feel free to reach me out. Thank you in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 07:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511408#M105046</guid>
      <dc:creator>Stanislav1</dc:creator>
      <dc:date>2025-03-25T07:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511414#M105047</link>
      <description>&lt;P&gt;Since we don't know what kind of values are in the "value" field (could be text, integer etc), I will assume that you want to get rid of NULL values (not 0 values).&lt;BR /&gt;Try: Where NOT isnull(value);&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 08:15:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511414#M105047</guid>
      <dc:creator>KalmerKaljuste-BeTerna</dc:creator>
      <dc:date>2025-03-25T08:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511415#M105048</link>
      <description>&lt;P&gt;Forgive me for not clarifying. The values in the 'value' field are integers. I already tried filtering out the value column in the CrossTable() creation function, but without success, since CrossTable() is a transforming prefix and it is not a complete 'Load' or 'Resident'. I tried where NOT isnull(value) as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe possible solution could be to use 'Preceding Load' instead of using Resident in this case. However, I am not sure if this is possible with the CrossTable() function. Could you please elaborate on this proposition if it is possible or not? Thank you in advance.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/310869"&gt;@KalmerKaljuste-BeTerna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 08:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511415#M105048</guid>
      <dc:creator>Stanislav1</dc:creator>
      <dc:date>2025-03-25T08:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511501#M105067</link>
      <description>&lt;P&gt;You could try to replace the ZERO with NULL, maybe with something:&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;if(ads_cost = 0, null(), ads_cost) as ads_cost&lt;BR /&gt;...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 14:35:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511501#M105067</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-03-25T14:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511515#M105071</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;And what should I do next? Filter out the non null() values? If that is what you are referring, it doesn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 15:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511515#M105071</guid>
      <dc:creator>Stanislav1</dc:creator>
      <dc:date>2025-03-25T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511526#M105074</link>
      <description>&lt;P&gt;I'm not sure about it but if I remember correctly the NULL is while the crosstable-resolving skipped and needs no extra filtering. Just give it a try.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 15:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511526#M105074</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-03-25T15:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511529#M105076</link>
      <description>&lt;P&gt;I generated some dummy data and used your code. It seems to be working exactly as you want (I did it using QV as there is no more QS desktop available anymore).&lt;/P&gt;&lt;P&gt;googleplay.ads_group:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;eventDate, installDate, Source, event_time, install_time, event_type, package_name, device, country_code, isOrganic, ad_network, campaign, ad_group, ad_name, App, product_line, ads_cost, impressions, clicks&lt;BR /&gt;09.09.2024, 04.09.2024, ABC, 15:15:00, 10:15:00, EventTypeABC, PackageNameABC, 32141, EST, Yes, 31512, 432532, 525324, AD_Name_ABC, 5235238432, 4325946734, 666, 0, 100400&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;googleplay.ads_temp:&lt;BR /&gt;CrossTable('metric','value', 16)&lt;BR /&gt;LOAD&lt;BR /&gt;eventDate&lt;BR /&gt;,installDate&lt;BR /&gt;,Source&lt;BR /&gt;,event_time&lt;BR /&gt;,install_time&lt;BR /&gt;,event_type&lt;BR /&gt;,package_name&lt;BR /&gt;,device&lt;BR /&gt;,country_code&lt;BR /&gt;,isOrganic&lt;BR /&gt;,ad_network&lt;BR /&gt;,campaign&lt;BR /&gt;,ad_group&lt;BR /&gt;,ad_name&lt;BR /&gt;,App&lt;BR /&gt;,product_line&lt;BR /&gt;,ads_cost, impressions, clicks&lt;BR /&gt;Resident&lt;BR /&gt;googleplay.ads_group;&lt;BR /&gt;&lt;BR /&gt;drop table googleplay.ads_group;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;googleplay.ads: NoConcatenate&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT googleplay.ads_temp&lt;BR /&gt;WHERE value &amp;lt;&amp;gt; 0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;drop table googleplay.ads_temp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 15:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511529#M105076</guid>
      <dc:creator>KalmerKaljuste-BeTerna</dc:creator>
      <dc:date>2025-03-25T15:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511629#M105090</link>
      <description>&lt;P&gt;Yes, I know it is working as intended. However, I want to do the filtering for the value &amp;lt;&amp;gt; 0 in the CrossTable(). This way I will save a lot of time for the transformation, because I don't have to load the table second time using resident for filtering out the 0 values. Do you have any propositions how I can do that?&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/310869"&gt;@KalmerKaljuste-BeTerna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 09:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511629#M105090</guid>
      <dc:creator>Stanislav1</dc:creator>
      <dc:date>2025-03-26T09:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511640#M105092</link>
      <description>&lt;P&gt;You could add a filter which filters the data against the load which is only applicable if a complete record has no valid values but not against the crosstable-transforming. In your case this might be something like:&lt;/P&gt;&lt;P&gt;where rangesum(&lt;SPAN&gt;ads_cost, impressions, clicks);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Beside this you may to consider to skip the inbuilt crosstable-feature and loading the data manually which is especially simple if there are only a few not changing fields to transpose which might be even done within a loop, for example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for each f in 'ads_cost, impressions, clicks'&lt;BR /&gt;&amp;nbsp; t: load F1, F2, F3, '$(f)' as metric, $(f) as value from X where $(f);&lt;BR /&gt;next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would expect that such approach runs significantly faster as the crosstable-statement.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 09:58:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511640#M105092</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-03-26T09:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511685#M105100</link>
      <description>&lt;P&gt;I assume that you have huge amount of data. As I understand most likely the majority of the data is with 0 values, thus skipping them before crosstable is what you're trying to solve.&lt;BR /&gt;Having that mentioned, I agree with&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;- whether you "loop" through the 3 fields which may contain 0 as a value and you skip them OR you load the data once, then you may create 3 flags which determine whether one of the fields 'ads_cost', 'impressions', 'clicks' was 0. Now you load multiple tables using NoConcatenate without the field where the flag = 1 (when the value is 0). You perform the crosstable function for all possible combinations of possible fields.&lt;BR /&gt;I would build a SUB to call the cross table again with a variable of the existing fieldnames that you want to transform.&lt;BR /&gt;Please note that these steps might take as much time as dropping the 0's in the end.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 13:28:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511685#M105100</guid>
      <dc:creator>KalmerKaljuste-BeTerna</dc:creator>
      <dc:date>2025-03-26T13:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering out 0 values from CrossTable() function</title>
      <link>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511716#M105110</link>
      <description>&lt;P&gt;Thank you both&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp; &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/310869"&gt;@KalmerKaljuste-BeTerna&lt;/a&gt;&amp;nbsp; and for the useful thoughts and propositions for resolving this issue. After I transformed the ZERO values into Null values, the CrossTable() function automatically skipped the rows, thus improving the performance of my app by the expected 30-40%. Thank you again for your expertise and fast replies. The solution works flawlessly.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 15:36:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filtering-out-0-values-from-CrossTable-function/m-p/2511716#M105110</guid>
      <dc:creator>Stanislav1</dc:creator>
      <dc:date>2025-03-26T15:36:24Z</dc:date>
    </item>
  </channel>
</rss>

