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

QlikView Expression Set Selector Syntax for Multiple Fields

Can somebody please help me with the syntax for set selecting in an expression based on multiple fields?

I had originally used the syntax below, with a comma separated list of set selectors. And as far as I recall it was working just fine until yesterday.

=sum({$<[Fiscal year]={$(=max([Fiscal year]))}, [Product/Business Segment]={'FS'}>} [Net Invoice Price])

However, I discovered that today, the expression does not work anymore as intended. And instead of the syntax above, I find that I now need to use the syntax below..

=sum({$<[Fiscal year]={$(=max([Fiscal year]))}> * <[Product/Business Segment]={'FS'}>} [Net Invoice Price])

Could somebody please kindly explain to me why the one or the other syntax should work, and what is the difference between them both? And also can you please explain why suddenly the behavior could have changed between yesterday and today? I am worried that that I have other expressions in other objects using the first syntax, which still seem to work OK, and I am concerned that they might suddenly stop working..

6 Replies
vishsaggi
Champion III
Champion III

Read Here Operators sections:

Set analysis and set expressions ‒ QlikView

Anonymous
Not applicable
Author

Sorry Vishwarath but your link does NOT help. I had read it anyway before I posted, and if it would have helped, I would not have posted. Your link specifically describes two syntaxes as show below. So what is the difference between them? And why does one of them work and the other one not? Why does one work in one object and not in another object in the same application?

Sum({$<Year={2000}, Region={“U*”}>} Sales)

Sum({$<Year={2009}> * <Country={"Sweden"}>} Sales)

juraj_misina
Luminary Alumni
Luminary Alumni

The two expressions should be basically the same. Wasn't there some unexpected change in data? Something that would change/brake associations for example?

Digvijay_Singh

One difference I could see in below sample is, the first one disregard the selection made in the fields used in set modifier but '*' operator is not disregarding the selections made in underlying fields. Both show same value when underlying fields are not in current selection. See below -

Capture.PNG

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Don't think so. They're not the same. But your remark about the data that changes is probably spot on.

The first expression takes the currect selection set and modifies some of the selections before assembling the resulting set of rows. In Digvijay's example, that would be value 100.

The second example takes two current selection sets and modifies them individually, after which an intersection is calculated. In Digvijay's example, that would come down to figuring out the common rows of sets {300} and {100, 200}. No results...

juraj_misina
Luminary Alumni
Luminary Alumni

Yes, you're both perfectly right. So the change in data seems to most probable. An expression simply does not stop working from its own will, there must be some outer impulse (QV/QS upgrade, data change...).