Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Stanislav1
Contributor III
Contributor III

Filtering out 0 values from CrossTable() function

Hello everybody,

 

I have the following issue, which If I solve I will improve the time efficiency of my app with 30-40%. 

Now, I am using a CrossTable() function to seperate the metrics and their corresponding values.

For each metric where there is no value it also creates a row, which makes the size of the final table a problem.

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.

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. 

For your convenience, I will add the code here in the chat as well:

googleplay.ads_temp: CrossTable('metric','value', 16)
LOAD
[#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
Resident
googleplay.ads_group;
 
drop table googleplay.ads_group;
 
googleplay.ads: NoConcatenate
LOAD *
RESIDENT googleplay.ads_temp
WHERE value <> 0; 
 

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. 

 

Labels (3)
10 Replies
Stanislav1
Contributor III
Contributor III
Author

Thank you both @marcus_sommer  @KalmerKaljuste-BeTerna  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.