Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
patrou38
Creator
Creator

Static expression

Hello,

I need to have a static expression, mean not depending to any filters selected.

In my example attached, the chart not change if no weeks selected or I flast week (46) is selected. this is a good behavior, but If I select an other week the chart becomes blank and my target is that I would like to show always the last week (week 46 in my example).

I hope that I was enough clear.

thank you in advance for your help.

regards,

Patrick

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Use {1} as rge base set in a set expression. This ignores all selections. Like this:

=Sum({1} Amount)               // ignore all selections

or

=Sum({1<Week = {"$(=Max(Week))"}>} Amount)  // last week or last selected week

or

=Sum({1<Week = {"$(=Max({1} Week))"}>} Amount)  // last week

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Use {1} as rge base set in a set expression. This ignores all selections. Like this:

=Sum({1} Amount)               // ignore all selections

or

=Sum({1<Week = {"$(=Max(Week))"}>} Amount)  // last week or last selected week

or

=Sum({1<Week = {"$(=Max({1} Week))"}>} Amount)  // last week

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
patrou38
Creator
Creator
Author

thank you for your quick answer.

patrou38
Creator
Creator
Author

One more question, it's works as it is ( =count({1<Week={$(vPreviousWeek)}>}Lot) ) with one or more static 'field'.

but if I would like to have 1 static field (without any action in the amount), like Week in this example but other filters potentially selected able to modified the result of the expression.

I don't know if I'm clear... in my example the Week is frozen, but I want that if I select a Site, the amount must be impacted.

jonathandienst
Partner - Champion III
Partner - Champion III

I am a little confused

original post >> mean not depending to any filters selected

and

now >> the amount must be impacted

So which is it? {1<...>} will override the other selections as you requested in your original post. Or if you want to respect selections use {$<...>}. If you want to ignore slections in all fields except one or two, then use

{1<Field1 = $::Field1, ....>}

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
patrou38
Creator
Creator
Author

Hello Jonathan ,

Sorry to make you confused.

You're right, my request evoluted. now in the same expression, I would like to freeze 1 field (Week in my example) but I want the chart potentially modified when the user select 1 site or 1 people (see my attached example )

Expression used in the chart are:

= count({1<Week={$(vMaxWeek)}>}Lot)

=sum({1<Week={$(vMaxWeek)}>}NotFoundInEDA)

Capture.JPG

Thank you in advance.

regards

jonathandienst
Partner - Champion III
Partner - Champion III

Just remove the 1 from the set expressions so that all other fields respond to user selections in the normal way.

If that is not what you after, I suggest that you start a new thread.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein