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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
JulsESC
Contributor II
Contributor II

Filter data from a table based on two columns

Hi, I would like to select a list of products that belong to a specific agent and then create an Excel file for each product. The creation of the Excel files should be done in a loop until the list is completed with the last product. Does anyone know how to apply two filters to extract data from a table in a dashboard? (I have tried using IF before, but it doesn't work). In this example, I need to extract the entire table for agent RD and create an Excel file for each product.

JulsESC_0-1740776616208.png

 

 

Labels (2)
1 Reply
ramchalla
Creator II
Creator II

Hi JulsEsc,

Please find the attached qvw file and test file that I used for this. You can try this and let me know if this will resolve your issue.

Test:
 
LOAD Agent, 
     Product, 
     Nome, 
     Quantita, 
     Prezzo
FROM
[D:\Qlik Sense\Practice1.xlsx]
(ooxml, embedded labels, table is Sheet1);
 
for each AgentValue in FieldValueList('Agent')
 
for each ProdValue in FieldValueList('Product')
 
$(AgentValue)_$(ProdValue):
 
NoConcatenate
 
LOAD
Agent,
    Product,
    Nome, 
    Quantita, 
    Prezzo
    
   Resident Test
   Where Product = '$(ProdValue)'
   and Agent = '$(AgentValue)'
   ;
   
LET vNoofRows = NoOfRows('$(AgentValue)_$(ProdValue)');
 
 
IF vNoofRows > 0 then 
STORE $(AgentValue)_$(ProdValue) into D:\Qlik Sense\$(AgentValue)_$(ProdValue).csv(txt);
ENDIF
   
DROP Table $(AgentValue)_$(ProdValue); 
 
NEXT 
 
NEXT   
      
DROP Table Test;