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

Getfieldselections Function for multiple items

Good Day

I have a model where the user will select a period (month & year) and one of my objects needs to calculate the Actual YTD up to and including the selected period.  For this, I am explicitly stating in my object's expression that the current selections must be ignored but that the Actual amount must be calculated up to and including the selected period ... sum( {1} if ( [Fiscal Period] <= getfieldselections([Fiscal Period]) , Actual) ..

My problem is that I also need to allow the user to select different expense categories such as Fuel, Wages etc.  But, because I'm using {1} in my expression, my object isn't dynamically updating through Expense Category selections made.  I've tried using the getfieldselections function in my expression for Expense Categories but it only works for one selected item.  How can I get this to work for multiple selected items and when no Expense Category is selected?

Please help, I need assistance urgently

Thanks,

Shane

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example

the logic in the expression is to calculate year to date

it show all values from maximum date to year statr for the maximum date

View solution in original post

7 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

insted of using {1} in your set analysis

why cant you use somthing like {<month=,year=>}

Not applicable
Author

Hi Liron,

I have tried your suggestion but it returns a blank result.  I'm not sure if I have the syntax correct:

sum({<[Financial Category Description] = {'Expenses'}, [Fiscal Period] = {"<=$ (=vCurrentMonthNum)"}>}Actual)

Thanks

lironbaram
Partner - Master III
Partner - Master III

sum({<[Financial Category Description] = {'Expenses'}, [Fiscal Period] = {"<=$ (#vCurrentMonthNum)"},year=,month=>}Actual)

or can you post sample data

Not applicable
Author

Hi,

Try is with double quots around Expenses.

Succes, Halmar

Not applicable
Author

Hi, I've created a sample document that simplifies what I'm doing.  What I need is the line graph to show up to the selected period but the line graph must also be affected by selections made on the Account Category.  I really appreciate the responses guys.  Thanks, SJ

lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example

the logic in the expression is to calculate year to date

it show all values from maximum date to year statr for the maximum date

Not applicable
Author

Thanks so much Liron.  Your solution is just what I'm aiming for.