Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight table condition

Hi Folks,

I am new to QlikView and have been trying to find a solution for a problem with no success. Below is the scenario, hope someone can help or guide me in the right direction.

I have a list box of products and i have created two list boxes from it one of which is in Alternate state, Say Product1 and Product2(Product2 is in Alternate State). I need to select one product from each of the two list boxes and I want a straight table to display two things:

1. List of Companies which have bought both the products(Once this is acheived then the sales-amount and OrderIDs for the two respective products) and

2. Similarly List of companies which have bought Product1 but not Product2.

I need the straight table to display the name of the Company, OrderID and Sales-amount. I am capturing the selection in Product1 into a variable vGroup1 and similarly the second in vGroup2. Once I am successfully able to display the 'right' company names in the straight table then ill go deeper and display the sales-amount for each of the two products and their respective OrderIDs.

I have been able to display the both in a textbox via the following commands:

For point 1 = Concat({<ProductName={'$(vGroup1)'}> * <ProductName={'$(vGroup2)'}>}Customers.CompanyName, ', ')

For point 2 = Concat({<ProductName={'$(vGroup1)'}> - <ProductName={'$(vGroup2)'}>}Customers.CompanyName, ', ')

But i have tried multiple variations(including Enable Conditional) of the same formula to display it in Straight Table but all it displays is Companies which have bought Product1 or at other times some some different combinations.

Really appreciate everyones time and efforts....

16 Replies
morganaaron
Specialist
Specialist

Oops - apologies, that's just left over from my code - that should read "Customer" or whatever field you're using to identify the dimension!

Not applicable
Author

Thanks for the prompt reply, i guess i am encountering the same problem i faced with a similar expression. There is a 'red line' under the closing curly braces of State1. In place of State1 i have used the name of the variable which is holding the selection from the first listbox.

Anyways, I appreciate everyones time for the post so far.

morganaaron
Specialist
Specialist

That suggests a syntax error - does it say Expression OK or is it registering there's an issue?

I haven't encountered any errors in mine - happy to look at your code if you want to paste what you're trying to use?

Not applicable
Author

I am using the following code, where vGroup1 is a variable which is capturing the selection from First Text box

=Sum({<Customers.CompanyName = P({'$(vGroup1)'}Customers.CompanyName)>}OrderSalesAmount)

kiranmanoharrode
Creator III
Creator III

Hi Muntazir,

Search for AND mode implementation in Qlik community. AND mode implementation on List box will be the best practice to solve both points that you have mentioned above.

Here is a helpful link.

http://community.qlik.com/blogs/qlikviewdesignblog/2013/07/19/and-mode

Regards,

Kiran

kiranmanoharrode
Creator III
Creator III

Try to implement AND mode on Product field.

morganaaron
Specialist
Specialist

I managed to get it to work from your example by using Customers.CompanyName as the dimension and:

=Sum({<Customers.CompanyName = P({State1}Customers.CompanyName)>}OrderSalesAmount)
As the expression. Weird it's not working for you!