Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasmahajan

pick Wildmatch with 2 conditions

Hi Team,

I want to impalement  pick wildmatch with  2 conditions 

like following :

 

Pick(Match(Time_Period,'YTD','MAT','Relative Qtr','3M Roll Avg','Cal Year','Cal Month','Cal Qtr') and 

GetFieldSelections(Measures) = 'Sales $' 

Thanks in adv.

Vikas

 

 

 

 

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Labels (2)
3 Replies
Vegar
MVP
MVP

Your question is missing some detail in order for me/us to help you with the specifics, nut I'll try to give you a more generic answer.

You want to create an expression combining the two functions pick and wildmatch where these functions are constructed using the formats listed below.

pick (n, expr1[ , expr2,...exprN])

wildmatch ( str, expr1 [ , expr2,...exprN ])

In a pick (wildmatch()) setup you want to replace the of the pick() with the output of the wildmatch() like this.

pick ( wildmatch ( str, expr1 [ , expr2,...exprN ]) , expr1[ , expr2,...exprN])

Let use it in an example classifying the content of the fiels [Word] as a-words, b-words and c-words.

pick(wildmatch ([Word], 'a*','c*','b*'), 'A-word','C-Word','B-Word'))

I hope this was helpful for you. If you need help with the specifics of your application then please provide more input on what you are trying to do and what output you get from your current attempts. 

 

- Vegar

vikasmahajan
Author

Sorry for that,

I need to optimize my following expressions  I created island filter pane  when user will select  Sales$ measure & 

Time_period  accordingly I need to the values if user select YTD & MAT & sales $ measure it should give 2 values YTD & MAT in pivot table.

 

 

GetFieldSelections(Measures) = 'Sales $'
and

Pick(Match(Time_Period,'YTD','MAT','Relative Qtr','3M Roll Avg','Cal Year','Cal Month','Cal Qtr'),

//'SalesYTD'
Sum({<New_Flag_YTD = {1} , MonthNumber = { $(=$(vMaxMonth) ) }> }Sales_Dollars),

//'Sales MAT'
Sum( {< Flag_Rolling12Months = {1} , MonthNumber = { $(=$(vMaxMonth) ) } > } Sales_Dollars),

//'Relative Qtr'
Sum({<Flag_Rolling3Months = {1},CALENDAR_Month_3MRolling = {'$(=$(v_CALENDAR_Month_3MRolling) )'}>} Sales_Dollars),

//'3M Roll Avg'
sum({<CalMonthYear=,MonthName,Flag_Rolling3Months = {1},CalMonthYear={">=$(v_MonthStart) <=$(=max(MonthYear))"}>} Sales_Dollars)/3,

//'Cal Year'
Sum( {<Flag_YTD = {1} > }Sales_Dollars),

//'Cal Month'
Sum( {< Flag_MTD = {1} > }Sales_Dollars),
//'Cal Qtr'
Sum( {< Flag_QTD = {1} > }Sales_Dollars)
)

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Vegar
MVP
MVP

I don't  think you can get two expressions to display from one measure. 

What about creating a dynamic report with one measure per time dimension. Then you can control which expression  that is displayed in your pivot using show/hide conditions on the measures of the pivot table.