Announcements
cancel
Showing results for
Did you mean:
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
Partner - Specialist

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

Thanks and Regards
Kashyap.R
5 Replies
Contributor III

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

Partner - Specialist

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

Thanks and Regards
Kashyap.R
Contributor III

kashyap , thanks for your correction,

Creator II
Author

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)

Partner - Specialist

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

Thanks and Regards
Kashyap.R