Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

GetCurrentSelections()

I am trying to write an IF() that will return a value when a field within a group is selected. So I have something along the lines of whats below. However, the function is returning Sum(Sales) when any field in Annual Analysis is selected, not just 2015 YTD like I want. Any suggestions? Thanks in advance.

=IF(GetCurrentSelections([Annual Analysis]) = '2015 YTD', Sum(Sales)))

Tags (1)
1 Solution

Accepted Solutions

Re: GetCurrentSelections()

Try this:

=If(WildMatch(GetFieldSelections([Annual Analysis]), '2015 YTD'), Sum(Sales))

6 Replies

Re: GetCurrentSelections()

Try this:

=If(WildMatch(GetFieldSelections([Annual Analysis]), '2015 YTD'), Sum(Sales))

Not applicable

Re: GetCurrentSelections()

Yes that worked! how does WildMatch work?

antoniotiman
Honored Contributor III

Re: GetCurrentSelections()

If You haveDimension [Annual Analysis] in Your Group try

If(GetCurrentField(YourGroup)='Annual Analysis',Sum({<[Annual Analysis]={'2015 YTD'}>} Sales))

Re: GetCurrentSelections()

Not entirely sure what you are doing and how you data looks. if what ANTONIO‌ said did not work, would you be able to share a sample?

Best,

Sunny

Not applicable

Re: GetCurrentSelections()

I spoke too soon, =If(WildMatch(GetFieldSelections([Annual Analysis]), '2015 YTD'), Sum(Sales)) worked. How does WildMatch work?

Re: GetCurrentSelections()

Here is an image from QV Help page:

Capture.PNG

I hope this will clarify things.

Best,

Sunny