Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Question about set analysis current selection identifier

Hi everyone,

I have a column of data which contains multiple order numbers. I am using set analysis to count the total number of orders based on their status, either open or closed. Here is my expression:

count(Distinct{$<[PO Status2]={"O"}>} po_NUMBER_ITEM)

Where [PO Status2] is the order status and po_NUMBER_ITEM is the order number. I have the same expression for [PO Status2]="C" to count the closed orders. Both expressions calculate the totals correctly and are used in a gauge chart.

I have a list box where I can select either the open or closed orders. I would like for the total in my gauge chart to change based on the order status selected. For example, if I select "O" I would expect the total number of closed orders to show 0 and if I select "C" I want the total number of open orders to show 0. As it is right now however, the total does not changed based on the status selected.

I thought using the $ identifier would allow the expression to change based on the values selected but it looks like that is not working.

A sample qvw file is attached. Any idea what I'm doing wrong?

Thanks in advance.

Michael

1 Solution

Accepted Solutions
sunny_talwar

Check out the attached

Open: Count(Distinct{$<[PO Status2] -={"C"}>} po_NUMBER_ITEM)

Closed: Count(Distinct{$<[PO Status2]-={"O"}>} po_NUMBER_ITEM)

View solution in original post

3 Replies
sunny_talwar

Check out the attached

Open: Count(Distinct{$<[PO Status2] -={"C"}>} po_NUMBER_ITEM)

Closed: Count(Distinct{$<[PO Status2]-={"O"}>} po_NUMBER_ITEM)

israelcsouza
Contributor III
Contributor III

This is it?

swuehl
MVP
MVP

That's because your field modifier is using a constant value, overriding user selections.

As a general rule, if you want to consider user selections, use the intersection operator *

Open:

count(Distinct{$<[PO Status2] *= {'O'}>} po_NUMBER_ITEM)

Close:

count(Distinct{$<[PO Status2] *= {'C'}>} po_NUMBER_ITEM)