Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis not working when selections are made

Hi

I am having a problem that my set analysis is working fine when I dont have a selection made but not working when I am making a selection in Qlikview.

=only({<FinancialYearID={'$(=max(FinancialYearID))'}>}Fiskalår)&chr(10)&'Budget'

The above function works fine. But the below works fine when I have no selection but has no values displayed when I make a selection in Qlikview.

=only({<FinancialYearID={'$(=max(FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'

I am making a comparison between year where I want to compare the previous year with the year selected. I can not figure out why the function that is not working is not working. Thanks for any help I am completely clueless on this one.

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

It needs analysis on your data model.

Try with this

only({1<FinancialYearID={'$(=max(FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'


Note: It ignores all the selections

View solution in original post

9 Replies
nilesh_gangurde
Partner - Specialist
Partner - Specialist

Hi,

You need to ignore the selections from the "max(FinancialYearID)".

like if you are selecting Field1 and Field2 then add this  max({<Field1=,Field2=>}FinancialYearID).

-Hope this will help.

-Nilesh

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

It needs analysis on your data model.

Try with this

only({1<FinancialYearID={'$(=max(FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'


Note: It ignores all the selections

jfkinspari
Partner - Specialist
Partner - Specialist

It does depend on whether your Max(FinancialYear) always should show the max value in the data, or it should respect your other selections.

In case it should always result in the max year, you could change the formula to

=only({<FinancialYearID={'$(=max({1}FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'

MayilVahanan

HI

Try like this

=only({1<FinancialYearID={'$(=max({1}FinancialYearID)-1)'}>}Fiskalår)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
er_mohit
Master II
Master II

try this

=only({<FinancialYearID*={'$(=max(FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'

Not applicable
Author

Thanks for all the fast answers and input. This is the right answer.

Note: However it does not ignore all selections it takes the max FinancialYearID selected and displays the Fiskalår -1 FinancialYearID. I think that is because the 1 refers to ignore the selection of the values for the Fiscalår field.

Not applicable
Author

only({1<FinancialYearID={'$(=max(FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'

CELAMBARASAN
Partner - Champion
Partner - Champion

If you want to ignore selections for the Max(FinancialYearID) then use

Max({1} FinancialYearID)

Hope it helps

Celambarasan

Not applicable
Author

I want it to not ignore the selection for the Max(FinancialYearID) so the above answer with

"only({1<FinancialYearID={'$(=max(FinancialYearID)-1)'}>}Fiskalår)&chr(10)&'Budget'" works good,