# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for
Did you mean:
Highlighted
Creator II

## Logic help

Hi,

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

1 Solution

Accepted Solutions
Highlighted
Partner

## Re: Logic help

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

5 Replies
Highlighted
Contributor III

## Re: Logic help

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

Highlighted
Partner

## Re: Logic help

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

Highlighted
Contributor III

## Re: Logic help

kashyap , thanks for your correction,

Highlighted
Creator II

## Re: Logic help

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)

Highlighted
Partner

## Re: Logic help

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