Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I wish to pick the i'th element of a concatenated selection
=pick(1, concat( [Field], ', ' ))
I would have thought that I should be possible however, currently the second argument is interpreted as a single argument and not as many.
Is my approach possible and am I just missing something?
I think the issue with the space after comma in the Getfieldselections delimiter parameter. To understand this better, please see below screenshot. Have a look at the attached file. You can check easily spot the issue by adding the expression straight table like below .
Well Spotted! Thank you
Christoph Weber wrote:
Thank you, the placement of char(39) is still a mystery to me.
Chr(39) is nothing but a single quote. We have to add single quotes around the selected values so I just used chr(39) here. You may ask why not use single quotes directly. If we use single quotes around the filed name then QlikView will consider that as a Text instead of field name.
Below link may help you to understand about Ascii table.
Hope this is clear now.
No Problem. Have a fantastic day!
Thank you for that explanation.
I know about the effects and ' as well as the use of chr(39).
It is just its application together with the $-expansion that has me at a loss, sometimes.
Agree with you. Sometimes it will confuse us.
I appreciate the momentum of this discussion and would like to go a little beyond the scope of the question:
And want to relate to your answers here:
I have a small selection and a number field.
Now i want to show the rank of one specific field by somehow extending the following: =aggr(Rank( sum( {1} [Numbers]) ) , [Field])
This is my failing solution, so far.
=aggr(Rank( sum( {1<[Field]={'$(=SubField(GetFieldSelections( [Field],',',3),',',1))'}>} [Numbers]) ) , [Field])
What am I doing wrong?
I'm sorry. Could you please explain with sample data and expected output. It will be really easy for me to provide you some idea. Hope this is fine with you.
Load *
inline [
Field, Numbers
A , 1
B, 2
C, 3
D, 4
]
Assuming any selection,
I want to show the Rank of Element 'C' in a Textbox (or some other object with similar proeprties)
Basically:
=aggr(Rank( sum( {1<[Field]={'C'}>} [Numbers]) ) , [Field])
This should be 2 (As it has the second highest Number - I hope I apply Rank correctly)
You can simply try below expression in textbox,
=Aggr(Rank( sum( {1} [Numbers]) ),Field)