Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Logic help

Hi,

Can any one please help me on below requirement.

I have a table like below. Here requirement is need  to keep only TS flag wherever the Country has both TS and PS.

I can't made any change on Backend. Could you please provide the UI solution.

Qliksense UI Table:

Country                Flag

India                         TS    

India                         PS

US                              TS

UK                              TS

UK                              PS

Argentina                 PS

etc.....

Expected Output:

Country                Flag

India                         TS    

US                              TS

UK                              TS

Argentina                 PS

Thanks in advance

 

 

 

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Hi

Try this 

if(ISNUll(WildMatch(Flag,'PS')+WildMatch(Flag,'TS')),'TS','PS')

or

@srdheekonda  suggestion you can use that also but use the distinct flag in that formula because if the flag is repeated it will give wrong output

IF(AGGR(COUNT(Distinct Flag),Country)=2,'TS','PS')

Hope this helps

Thanks

View solution in original post

5 Replies
Highlighted
Contributor III
Contributor III

I think creating a measure with following formula solve your requirement : IF(AGGR(COUNT(FLAG),COUNTRY)=2,'TS','PS')

Highlighted
Partner
Partner

Hi

Try this 

if(ISNUll(WildMatch(Flag,'PS')+WildMatch(Flag,'TS')),'TS','PS')

or

@srdheekonda  suggestion you can use that also but use the distinct flag in that formula because if the flag is repeated it will give wrong output

IF(AGGR(COUNT(Distinct Flag),Country)=2,'TS','PS')

Hope this helps

Thanks

View solution in original post

Highlighted
Contributor III
Contributor III

kashyap , thanks for your correction,

 

Highlighted
Creator II
Creator II

Hi @kashyap and @srdheekonda 

Thanks for your help. The below logic is working fine but client want to filter the flag with TS or PS value. By adding in measure not able to filter.

Is there any way to move to backend. Could you please help me on this. The wild match expression is not working for me to put in backend.

IF(AGGR(COUNT(Distinct Flag),Country)=2,'TS',Flag)

 

Thanks in advance.

 

 

 

Highlighted
Partner
Partner

Hi

Try this as Dimension and rename it in front end

aggr(if(ISNUll(WildMatch(Flag,'PS')+WildMatch(Flag,'TS')),'TS','PS'),Country)

Hope this helps

Thanks