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

Help with Set Expression

I am trying to learn Set expressions to correct problems with existing dashboards for my company.

While I understand the basics of set expressions, I'm lost in the ones below, where there's a fieldname followed by an = then followed by a comma then another field and =, et cetera.

I know that the first is for CURRENT year whereas the second is for PRIOR year (based on our internal calendar we reference):

sum({<FISCALMO=,[Calendar Fiscal Month]=,[FISCALYR]={"$(=max({1} [FISCALYR]))"}>}SERVICE_ISSUE_COUNT)

sum({<FISCALMO=,[Calendar Fiscal Month]=,FISCALYR={"$(=max({1} FISCALYR)-1)"}>}SERVICE_ISSUE_COUNT)

I'm used to seeing sum({$<Field1 = {FieldValue1}, Field2 = {FieldValue2}>} SERVICE_ISSUE_COUNT), which isn't what the above follows???

Can anyone "human speak" what the above expressions are attempting? It's returning...answers, just not 100% if they're correct answers.

Thanks in advance!
Jonathan

1 Solution

Accepted Solutions
avkeep01
Partner - Specialist
Partner - Specialist

Hi Jonathan,

I've got some useful documentation for you on this topic.

Translation:

sum({<FISCALMO=,[Calendar Fiscal Month]=,[FISCALYR]={"$(=max({1} [FISCALYR]))"}>}SERVICE_ISSUE_COUNT)


SUM(SERVICE_ISSUE_COUNT) Where selections on FISCALMO, [Calendar Fiscal Month] are ignored. = means don't do anything with the selection.


Then for [FISCALYR] there is set analysis used within the set analysis. "$(=max({1} [FISCALYR]))" means Pick the maximum FISCALYR and ignore all selections. {1} is ignoring all selections.


so it meas: show the sum of the service issue count for the maximum fiscalyear, while ignoring month selections .



"$(=max({1} FISCALYR)-1)" is the same but max year - 1.


View solution in original post

8 Replies
ogautier62
Specialist II
Specialist II

Hi,

that seems to react as no selection is taken in account for the field,

so equivalent to 1<field = {'*'}>

regards

avkeep01
Partner - Specialist
Partner - Specialist

Hi Jonathan,

I've got some useful documentation for you on this topic.

Translation:

sum({<FISCALMO=,[Calendar Fiscal Month]=,[FISCALYR]={"$(=max({1} [FISCALYR]))"}>}SERVICE_ISSUE_COUNT)


SUM(SERVICE_ISSUE_COUNT) Where selections on FISCALMO, [Calendar Fiscal Month] are ignored. = means don't do anything with the selection.


Then for [FISCALYR] there is set analysis used within the set analysis. "$(=max({1} [FISCALYR]))" means Pick the maximum FISCALYR and ignore all selections. {1} is ignoring all selections.


so it meas: show the sum of the service issue count for the maximum fiscalyear, while ignoring month selections .



"$(=max({1} FISCALYR)-1)" is the same but max year - 1.


sunny_talwar

The bold part of the expression is just saying that ignore any selections made in those two fields. So, if you select FISCALMO 3, the values that the expression is showing won't change (compared to if you have not selected anything)

Sum({<FISCALMO=,[Calendar Fiscal Month]=,[FISCALYR]={"$(=max({1} [FISCALYR]))"}>}SERVICE_ISSUE_COUNT)

The above can also be written like this (without the equal sign) and means the same exact thing

Sum({<FISCALMO, [Calendar Fiscal Month], [FISCALYR]={"$(=max({1} [FISCALYR]))"}>}SERVICE_ISSUE_COUNT)

schneider2037
Creator
Creator
Author

Thank you! The documentation is outstanding, and your explanation spot on.

On an aside, it seems a rather cumbersome way to achieve the objective, but as it is working, not going to try and fix it!

~Jonathan

schneider2037
Creator
Creator
Author

Sunny - thanks! I was just thinking "well THIS is an odd way to achieve the objective."

sunny_talwar

"well THIS is an odd way to achieve the objective."

How else can achieve the same output? I mean if you always want to see the whole year for one object and then the other one should show based on selection in FISCALMO... how would you do it?

schneider2037
Creator
Creator
Author

Meant more along the lines of the syntax used (your version is a lot cleaner to read in my mind).

These set expressions are still a bit beyond my comprehension. Thanks again for the assist!

sunny_talwar

Meant more along the lines of the syntax used (your version is a lot cleaner to read in my mind).

Gotchya!! Well, I rarely use the equal sign, but I know a lot of people use it with the equal sign. Not sure if what I use is by design or a bug that Qlik never fixed it...

These set expressions are still a bit beyond my comprehension.

Isn't that true for syntax of any new language you are trying to learn. But I am sure you will get a hang of it.

Best,

Sunny