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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
LoKi_asterix
Contributor III
Contributor III

Flag Customers with Two Different Statuses

Hi all,

I'm trying to identify customers who have two or more different status values within the data, and I would appreciate guidance on how to achieve this both in the Edit Script and through an expression that can be used in a chart or table.

Thank you in advance for your support!

LoKi_asterix_0-1752666834136.png

Tried this Sum({< Name = {'=Count( {1} Status) >1'}>} Purchase)

and 

CustomerMonthlyStatusFlag:
LOAD
Number,
Month Year,
IF(COUNT(DISTINCT Status) >= 2, 1, 0) AS HasMultipleStatuses
RESIDENT YourMainTable
GROUP BY Number, Month Year;

Labels (3)
1 Solution

Accepted Solutions
priyanka181088
Partner - Contributor II
Partner - Contributor II

use the same script and change the set analysis as below

Sum({< HasMultipleStatuses = {1}>} Purchase)

 

Thanks,

Priyanka

 

View solution in original post

2 Replies
Or
MVP
MVP

I don't see anything wrong with the script code. You may want to check that the Month Year field is actually month-year and does not have an underlying date. 

 

On the front end, assuming Number and Month Year are dimensions, you could just use the same formula as the expression, basically:

IF(COUNT(DISTINCT Status) >= 2, 1, 0) 

priyanka181088
Partner - Contributor II
Partner - Contributor II

use the same script and change the set analysis as below

Sum({< HasMultipleStatuses = {1}>} Purchase)

 

Thanks,

Priyanka