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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hakandikmen
Contributor
Contributor

Group by, compare and count

All keys start with support.

If there is a value other than the support in the group, don't write it in the support area. But if there is a support or support_ex value in it, let it write it in the support area.

 

1. Data with only suport

2. From Support to DEV

3. From Support to INFO

 

Thanks..

 

hakandikmen_0-1680912823601.png

 

 

Labels (1)
3 Replies
BrunPierre
Partner - Master II
Partner - Master II

Hi, here's one approach using mapping.

BrunPierre_0-1680945266227.png

 

UserGroupMap:
Mapping LOAD IF(KEY&'/'&USER_GROUP='WEV-70/DEV','WEV-70D',IF(KEY&'/'&USER_GROUP='WEV-70D/INFO','WEV-70I',KEY)) as KEY,
             USER_GROUP
Inline [
KEY,USER_GROUP
A-100,SUPPORT(or SUPPORT_EX)
ATM-30,DEV
WEV-70,DEV
WEV-70,INFO
ATM-31,INFO
ATM-75,INFO
];

Data:   
LOAD USER_GROUP,
     KEY,
     Count(DISTINCT KEY) as Count
     
Group By USER_GROUP, KEY;

LOAD KEY,
ApplyMap('UserGroupMap',IF(KEY&'/'&USER_GROUP='WEV-70/DEV','WEV-70D',IF(KEY&'/'&USER_GROUP='WEV-70D/INFO','WEV-70I',KEY))) as USER_GROUP

Inline [
KEY,USER_GROUP
ATM-30,SUPPORT
ATM-30,DEV
WEV-70,SUPPORT
WEV-70,DEV
WEV-70,INFO
ATM-31,SUPPORT
ATM-31,SUPPORT_EX
ATM-31,INFO
A-100,SUPPORT
A-100,SUPPORT_EX
ATM-75,SUPPORT
ATM-75,SUPPORT_EX
ATM-75,INFO
];

EXIT SCRIPT;
Kushal_Chawda

@hakandikmen  try with below expression

=count(distinct{<KEY= e({1<USER_GROUP-={'SUPPORT_EX','SUPPORT'}>})>+<USER_GROUP={'DEV','INFO'}>} KEY)
hakandikmen
Contributor
Contributor
Author

thanks.

 

How can I add this to the script side?

 

Here comes out of the support. ok.

So what should I do if I just want Support to look? only support in group KEY