Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Distinct of Selection

Hi!

i need to solve this problem...

In my Database( DB in example) i have ID with different STATUS (a or b) , a value variable € and Date (date of the status).

For each ID it is possible to have both Status or only one.

1- I need to count ID the have at least one record in Status a and one record in Status b.

2- For that ID i need to sum € only for status b. (in another words: It is important to have a total of € in status b but i've to consider only ID the have also one in status a).

It's a little bit complicate for me...

Thank you!!

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Yes it is possible with set expression.

    Create a straight chart with dimension as ID and expression as below.

    sum({<ID =  p ({<Status = {"A"}>}) * p ({<Status = {"B"}>}), Status = {"B"}>}€)

Regards,

Kaushik Solanki  

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Yes it is possible with set expression.

    Create a straight chart with dimension as ID and expression as below.

    sum({<ID =  p ({<Status = {"A"}>}) * p ({<Status = {"B"}>}), Status = {"B"}>}€)

Regards,

Kaushik Solanki  

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thank you!!

Regards

Marco

Not applicable
Author

Thank you!!

Regards

Marco