Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

Match function

Hi,

In a calculated dimension i have to write this match function

if the code is 01,02 then its Murder,

if the code is 05,06 then its Robbery,

if the code is 11,12 then its kidnap

these three comes under Part1crime

if the code is 06,07 then its weapon crime,

if the code is 09,16 then its Drugs

if the code is 115,812 then its Forgery

These three comes under Part2 crime

Output:

Crime          2015        2016

Murder         56            45

Robbery          1            2      

kidnap            3             4

Part1crime     60           51

Weapon Crime  2           3

Drugs               8            1

Forgery            5             2

Part2crime        15           6


How to take the Above conditions as calculated dimensions can any one help me to get the output like that.


=if(Match(CODE,'01','02'),'Murder',IF(Match(CODE,'05','06'),'Robbery',If(Match(CODE,'11','12'),'Kidnap')))

but not showing Murder,Robbery,Kidnap as Dimensions.


6 Replies
avinashelite

How is your CODE column Concatenated ??

try like this

if(Match(CODE,'*01*','*02*'),'Murder',IF(Match(CODE,'*05*','*06*'),'Robbery',If(Match(CODE,'*11*','*12*'),'Kidnap')))

Or

if(CODE='01' or CODE='02','Murder',IF(CODE='05' or CODE='06','Robbery',If(CODE='11' or CODE='12','Kidnap')))

PrashantSangle

Hi,

try like

if(match(code,01,02,05,06,11,12),'Part1crime')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
vikasmahajan

Attach sample qvw

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Anonymous
Not applicable

You can write If Condition like this?


IF(Code='01' or Code='02', 'Murder',

IF(Code='05' or Code='06', 'Robbery',

IF(Code='11' or Code='12', 'Kidnap'))) as NewDim





bhavvibudagam
Creator II
Creator II
Author

I have to prepare this chart.In "crime type" field All the Murder,Rape Robbery... Records are their.

Is it possible to Qulify only Murder,Rape,Robbery and Agg Assault under Total Violent.

How to take Total violent,Total Nonvio like this in below table.Is their any possibility please help me to do.Untitled.jpg

tyagishaila
Specialist
Specialist

concatenate a new attribute under field 'crime' with name 'Total Violent' and sum(reported) & sum(unfound)  for Murder,Rape,Robbery and Agg Assault.

Or can do it in set analysis .