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: 
Not applicable

Adding new data: Issues with expression and variable definition

Hi

I am new to Qlikview and encountered some problems when I tried to add new data into the dashboard

My dashboard currently have only product data for 'A' and 'M'.

Currently

My variable for the product is written as an expression:

vProduct:

=if(product='A', 'A', if(Product='M', 'M', if(GetSelectedCount(Product)=0, 0, if(GetSelectedCount(Product)>=2, 2))))))

and a straight table is created with this expression:

=if(Product=vProduct, date(Date), if(vProduct=0 or vProduct=2, date(Date), null()))

Everything works OK until I tried adding 2 new product into the dashboard: 'E' and 'X'

So I tried modifying the vProduct definition to the following:

=if(Product='A', 'A', if(Product='M', 'M', if(Product='E', 'E', if(Product='X', 'X', if(GetSelectedCount(Model)=0, 0, if(GetSelectedCount(Model)=2, 2, if(GetSelectedCount(Model)=3, 3, if(GetSelectedCount(Model)=4, 4)))))))

and modifying the straight table expression to the following:

=if(Product=vProduct, date(Date), if(vProduct=0 or vProduct=2 or vProduct=3 or vProduct=2, date(Date), null()))))

I encountered a problem: When I select more than 2 products or 2 products, it returns results for all 4 product in the straight table.


Can someone help me please? Are there any errors in the above expression that I have modified?

10 Replies
morganaaron
Specialist
Specialist

Hi Florence,

What's contained in the Activity_News field? Is that Date(date) a variable or a dimension? I think it's all going to revolve around the aggregation issue as Jonathan said.