Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Issue

Hello,

I have attached a part of our order data in a qvw file. i have the following fields:

Screenshot_1.jpg

What i need to do is to calculate for a specific PaymentType (Let's say PaymentType = 3), number of unique UserId's who doesn't have a failed payment log (PaymentStatus = 0)  but a succeeded transaction (PaymentStatus = 1). And i need it with the Date field in dimension.

I tried to use p() and e() functions in set analysis but it excluded users for all logs, disregarding the date dimension.

i tried : COUNT({<PaymentType = {"3"}, PaymentStatus = {1},UserId = e({<PaymentStatus = {0}>})>}DISTINCT UserId)

Thanks in advance.

8 Replies
Gysbert_Wassenaar

Perhaps this:

COUNT({<PaymentType = {3}, PaymentStatus = {1},UserId = e({<PaymentType = {3},PaymentStatus = {0}>})>}DISTINCT UserId)


talk is cheap, supply exceeds demand
ashfaq_haseeb
Champion III
Champion III

Hi,

Try below

=COUNT({<PaymentType = {3}, PaymentStatus = {1})>}DISTINCT UserId)

Regards

ASHFAQ

Not applicable
Author

Hi,

the e() function still excluding UserId's for all time logs. What i need is to calculate for each day count of unique users who doesn't have a log with PaymentStatus = 0. The e() function is disregarding the date dimension and exclude users for all days.

Not applicable
Author

try it like this

COUNT({<PaymentType = {"3"}, PaymentStatus = {1},UserId = e({<PaymentStatus = {0}>}UserID)>}DISTINCT UserId)

regards,

MT

Gysbert_Wassenaar

Ah, I understand what you're trying to do now. You cannot use set analysis because that calculates a set per chart, not per row, i.e. per date value in your case. Try adding a summary table in the script.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Ashfaq,

Your answer gives the count of users who have at least one succeeded payment log. Among them i need to exclude users who have failed (PaymentStatus = 0) at least once.

If we split users in a daily basis like the set i attached below. I only need users who did not failed.

set.png

Not applicable
Author

the result did not change

Not applicable
Author

This is a helpful answer.

It helps but to use it i need to store an extra table with a row count of Unique User Id per date.

But seems like there is no other way to do it.

Thanks