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

Depending selections

Hi community!!

I´m trying to get two secuential balance sheet in pivot table report, so I´ve got my main structure and In expressions tab I´ve got two calculations:

The first one is calculated depending on year field and I use GetFieldSelections(YEAR)

The second one is calculated depending on year field minus one. I write GetFieldSelections(YEAR)-1, but it doesn´t work.

Any idea? Thanks for your response.

Fiber9906

1 Solution

Accepted Solutions
saxjonas
Partner - Creator
Partner - Creator

I'm not sure what you're trying to achieve?

Are you trying to look at the SALDO for Customers which have a SALDO for the last year (Year-1) as well?

As you've already made a selection in AÑO you will not be able to get any data outside of that set. To get last years data you would do something like this using set analysis:

sum({$<AÑO={$(=AÑO-1)}>} SALDO)

If you instead want to show this years SALDO for those that has a SALDO last year you would instead want to use indirect set analysis using the p() function.

View solution in original post

5 Replies
saxjonas
Partner - Creator
Partner - Creator

I just tested it in a text box and it seems to be working properly.

Could you post the whole expression?

Not applicable
Author

The complete expresion is:

SUM

(IF(BALANCE='BSS' AND (GetFieldselections(AÑO)-1), SALDO, 0))

I tested too in text box and it works, but when I implemented on upper expresions it doesn´t show the correct values. I changed the arguments SALDO and 0, and it seems that works ok.

I´m surprised!! What do you think?

Fiber9906





saxjonas
Partner - Creator
Partner - Creator

I'm not sure what you're trying to achieve?

Are you trying to look at the SALDO for Customers which have a SALDO for the last year (Year-1) as well?

As you've already made a selection in AÑO you will not be able to get any data outside of that set. To get last years data you would do something like this using set analysis:

sum({$<AÑO={$(=AÑO-1)}>} SALDO)

If you instead want to show this years SALDO for those that has a SALDO last year you would instead want to use indirect set analysis using the p() function.

Not applicable
Author

That´s exactly what I´m looking for. Thank you so much Jonas.

Fiber9906

saxjonas
Partner - Creator
Partner - Creator

You're welcome 🙂