Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Uzumaki_N
Contributor III
Contributor III

Please someone breakdown and explain this expression?

pick(match(vDimension,'Year','Quarter','Month'),'Quarter','Month','Year')

 

Labels (3)
3 Replies
E_Røse
Creator II
Creator II

Say vDimension has the value 'quarter'. The expression match(vDimension,'Year','Quarter','Month') returns 2 because quarter is the second word in the list of search terms.

pick(2,'Quarter','Month','Year') returns  'Month'  because Month is the second value in  the list of values to pick from.

Please like and mark my answer as a solution, if it resolved your issue.

brunobertels
Master
Master

hi 

see this link 

https://community.qlik.com/t5/QlikView-App-Dev/can-any-one-explain-pick-and-match-function/td-p/8794... 

 

then for you 

pick(match(vDimension,'Year','Quarter','Month'),'Quarter','Month','Year')

you have a variable called vDiemension with value Year, Quarter, Month

Then your mesure give

if value Year is selected in your variable vDimension pick Quarter  as value 

if value Quarter is selected in your variable vDimension pick Month as value 

f value Month is selected in your variable vDimension pick Year as value 

neerajthakur
Creator III
Creator III

Hi @Uzumaki_N 

pick(match(vDimension,'Year','Quarter','Month'),'Quarter','Month','Year')

In your expression vDimension is variable

Match function returns numeric value/location of field value you are specifying. In this example suppose location of Year is 1, Quarter 2, Month 3

Now match will select the value will be supplied through variable vDimension suppose 2 and check what is 2 in this case it is Quarter here now Pick function comes in play.

Now our expression is like this:

Pick(2,'Quarter','Month','Year')

Here Pick will select value which is at 2nd place that is Month and will give you that value.

Hope it helps, I think you are supplying wrong order and you aren't getting the required results

pick(match(vDimension,'Year','Quarter','Month'),'Quarter','Month','Year')

Make the order of Year','Quarter','Month'  same in pick statement too.

 

If it helps please accept it as solutions 

Regards

Thanks & Regards,
Please Accepts as Solution if it solves your query.