Qlik Community

New to Qlik Sense

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

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashmitp869
Creator
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.

LOAD
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
Vegar
MVP
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

View solution in original post

1 Reply
Vegar
MVP
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

View solution in original post