# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for
Did you mean:
Creator

## Help to understand the use of pick and match function in qliksense script ?

Spoiler
Hi ,

Please kindly help me to understand the below pick and match use in qliksense script.

MakeDate(Year("End Date"),Month("End Date"),Day("End Date")) as ReportingDate,
pick(match("Care Type",'1','6','7','11'),'1','4','5','M','') as care_type,
1 as Measure;

SQL SELECT
End Date
"Care_Type" as "Episode of Care Type",
1 as Measure
From
Table

regards

1 Solution

Accepted Solutions
MVP

pick(match("Care Type",'1','6','7','11'),'1','4','5','M','') as care_type,

Match() returns a number depending on the [Care Type] value.

If [Care Type] is 1 then Match() returns 1

If [Care Type] is 6 then Match() returns 2

If [Care Type] is 7 then Match() returns 3

If [Care Type] is 11 then Match() returns 4

If [Care Type] is any other number then Match() returns 0

In a pick(match()) you use the value from your Match() to pick the Nth value in your pick list.

If  Match() returns 1 the pick() will return 1

If  Match() returns 2 the pick() will return 4

If  Match() returns 3 the pick() will return 5

If  Match() returns 4 the pick() will return M

If  Match() returns 0 the pick() will return nothing

I hope this explanation was understandable and of help.

- Vegar

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
MVP

pick(match("Care Type",'1','6','7','11'),'1','4','5','M','') as care_type,

Match() returns a number depending on the [Care Type] value.

If [Care Type] is 1 then Match() returns 1

If [Care Type] is 6 then Match() returns 2

If [Care Type] is 7 then Match() returns 3

If [Care Type] is 11 then Match() returns 4

If [Care Type] is any other number then Match() returns 0

In a pick(match()) you use the value from your Match() to pick the Nth value in your pick list.

If  Match() returns 1 the pick() will return 1

If  Match() returns 2 the pick() will return 4

If  Match() returns 3 the pick() will return 5

If  Match() returns 4 the pick() will return M

If  Match() returns 0 the pick() will return nothing

I hope this explanation was understandable and of help.

- Vegar

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Tags
Community Browser