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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinRamsey
Creator
Creator

Calculation Question

Good Morning,

I am working on adding a couple gauge visualizations to a dashboard I am creating and am needing a bit of help getting my expression to work. I am looking to count Orders only where OrderType = ZVK2,ZVE2, and ZVK3. I tried if(OrderType='ZVQ2', Count(OrderType)) as a test but it returns nothing. 

The two fields are related and are in the same table too just in case you were wondering. 

1 Solution

Accepted Solutions
JustinRamsey
Creator
Creator
Author

AHA! Figured it out! 

Correct function would be COUNT({<OrderType={ZVK2,ZVK3,ZVE2}>} %Key_Order)

View solution in original post

3 Replies
m_woolf
Master II
Master II

Try this:

= Count(<{OrderType={'ZVK2','ZVE2','ZVK3'}}>OrderType)

OrderType may not be the best field to count. Is there a field like "OrderNumber" that would be a primary key?

Might be better to use:

= Count(<{OrderType={'ZVK2','ZVE2','ZVK3'}}>OrderNumber)

 

 

JustinRamsey
Creator
Creator
Author

Yes there is %Key_Order that would be the order number. When I try your expression converting it to the correct field name at the end it shows it as an error and returns nothing. Appears it is considering the { the start of the offence. Any ideas? 

JustinRamsey
Creator
Creator
Author

AHA! Figured it out! 

Correct function would be COUNT({<OrderType={ZVK2,ZVK3,ZVE2}>} %Key_Order)