Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add field selection

Hi everyone,

I'm trying to extend a selection on a field by clicking a button. I defined an action on the field [FInicio EjercicioMes]:

='(' &     concat(distinct chr(34) & [FInicio EjercicioMes] & chr(34), '|') & '|' &

            concat(distinct chr(34) & p({1<[PeriodoTAM2]={1}>} [FInicio EjercicioMes]) & chr(34), '|')

     & ')'

so, my aim is to mantain the current selection of [FInicio EjercicioMes] and add those [FInicio EjercicioMes] with [PeriodoTAM2]={1}.

I am not sure if there is a grammar mistake or I took a wrong way...

Thanks in advance.

Marc.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

The field value is actually numeric. Your format changing has caused the issue. Expression should be:

='(' &  

            concat(  {$+1<[PeriodoTAM2]={1}>} distinct ([FInicio EjercicioMes]), '|')

    & ')'

Note: $ -> denotes current selection. This makes your expression simpler.

View solution in original post

8 Replies
tresesco
MVP
MVP

Try:

='(' &     concat(distinct chr(39) & [FInicio EjercicioMes] & chr(39), '|') & '|' &

            concat(distinct  {1<[PeriodoTAM2]={1}>} chr(39)& [FInicio EjercicioMes] & chr(39), '|')

     & ')'

Not applicable
Author

The result is like a clear: nothing selected on [FInicio EjercicioMes]...

tresesco
MVP
MVP

Use the above expression in a text box and see the output string. How does it look?

Not applicable
Author

I obtained different formats from each concat values. I've modified the expression:

='(' &     concat(distinct chr(39) & date(MonthName([FInicio EjercicioMes]),'MM-YYYY') & chr(39), '|') & '|' &

            concat(distinct  {1<[PeriodoTAM2]={'1'}>} chr(39)& date(MonthName([FInicio EjercicioMes]),'MM-YYYY') & chr(39), '|')

     & ')'

and the string is: ('01-2014'|'02-2014'|'04-2014'|'05-2014'|'06-2014')   , where the two first values are the selection and the other three are the wanted addition. But it doesn't work... same result: nothing selected.

tresesco
MVP
MVP

Try without chr(39). Single quotes are causing the issue.

='(' &     concat(distinct  date(MonthName([FInicio EjercicioMes]),'MM-YYYY') , '|') & '|' &

            concat(distinct  {1<[PeriodoTAM2]={'1'}>}  date(MonthName([FInicio EjercicioMes]),'MM-YYYY') , '|')

     & ')'

Not applicable
Author

same result. I add a qvw example...

tresesco
MVP
MVP

The field value is actually numeric. Your format changing has caused the issue. Expression should be:

='(' &  

            concat(  {$+1<[PeriodoTAM2]={1}>} distinct ([FInicio EjercicioMes]), '|')

    & ')'

Note: $ -> denotes current selection. This makes your expression simpler.

Not applicable
Author

It works fine. Thank you!