Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pascos88
Contributor

set expression doesn't work with a filter

HI,

I have this set expression as a measure in a table:

=maxstring({<CampaignYear = {"$(=Max(CampaignYear)-1)"}>}ValueUnappraised)

it works fine until I select a filter on a field called CampaignName.

it is well related, I already use it in other sheet..

Someone can see problem in the script?

If I exclude the set expression all the table works fine even with filter on CampaignName..


Some ideas?

8 Replies
MVP
MVP

Re: set expression doesn't work with a filter

May be this

=MaxString({<CampaignYear = {"$(=Max(CampaignYear)-1)"}, CampaignName>}ValueUnappraised)

MVP
MVP

Re: set expression doesn't work with a filter

Or this

=MaxString({<CampaignYear = {"$(=Max({<CampaignName>}CampaignYear)-1)"}>}ValueUnappraised)

pascos88
Contributor

Re: set expression doesn't work with a filter

With this, doesn't follow my filter on CampaignName.

If I select CampaignName = X it show CampaignName= Y..

I don't get the problem to be honest


This one:

=MaxString({<CampaignYear = {"$(=Max({<CampaignName>}CampaignYear)-1)"}>}ValueUnappraised)

I still have the some problem, once I select all the data desappear ..

MVP
MVP

Re: set expression doesn't work with a filter

Would you be able to share a sample to show the issue

pascos88
Contributor

Re: set expression doesn't work with a filter

It is a big app and unfortunally I cannot share it .

I try to explane better , what I have is this:

CampaignName      ValueUnappraised      Year

A2015                                   1000                         2015

A2015                                  3000                         2014

B                                   151                            2014

B                                   15                            2013


Now in the table I need to get ValueUnappraised  of the privius year, if my selection is A2015  and year 2015.

So my return should be 3000..

Now if I use the set expression that I put above, once I filter on A2015   the table is just without any values.


Do you have any idea? please let me know how I can give to you more info

                               

MVP
MVP

Re: set expression doesn't work with a filter

So, when you select A2015 and year 2015... you get 3000 (what you need)... but if you add set analysis, then it doesn't work? I am confused... which set analysis? the one I told you to add? or your initial one

pascos88
Contributor

Re: set expression doesn't work with a filter

I have filter pane on Campaign Name, and with my expression ( =maxstring({<CampaignYear = {"$(=Max(CampaignYear)-1)"}>}ValueUnappraised)) once I select a CampaignName, all the data in the table disappears.

with your set expression,

=MaxString({<CampaignYear = {"$(=Max(CampaignYear)-1)"}, CampaignName>}ValueUnappraised)

once I select a CampaignName, is not filter in the table, looks that I avoid this filter from the table.

In the end my scope is to have the ValueUnappraised on the privius Year.

MVP
MVP

Re: set expression doesn't work with a filter

It should not happen, not sure I will know without seeing a sample... May be this link can help you post a sample

Preparing examples for Upload - Reduction and Data Scrambling

Community Browser