Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bug in set analysis?

Hi All,

I have this data set:

 

ScenarioVersionProductAmount
Actual1A10
Actual2A9
AG1A12
AG2A11
AG3A13
FC1A9
FC2A10

In a straight table, product as dimension and expression as Sum({$<Product=,Scenario={'Actual'},Version={"$(=Max(Version))"}>} Amount), it's giving no result. If I select in Scenario Actual of FC, it's giving correct result that is 9. But if i select Scenario as AG, it's not giving any result again. Something to do with possible max version when selection is made. When nothing is selected, it's taking max(version)=3, and there is no actual for 3.

Please advise.

Thanks

SAK

1 Solution

Accepted Solutions
swuehl
MVP
MVP

The dollar sign expansion of $(=Max(Version)) will be performed before the actual expression will be evaluated, hence only once per chart and not considering the dimension. It's only considering user selection state.


If you need the max version per dimensional value, you can for example use FirstsortedValue:


FirstSortedValue( {$<Product=,Scenario={'Actual'} >} Amount, -Version)


Or if you want to find the max version of Scenario Actual, you can use a set expression within the dollar sign expansion;


Sum({$<Product=,Scenario={'Actual'},Version={"$(=Max({<Scenario = {'Actual'}>} Version))"}>} Amount)

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It is not the issue with Set analysis. It is with what you want.

If you can explain what you want probably that will help us to suggest you solution.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
swuehl
MVP
MVP

The dollar sign expansion of $(=Max(Version)) will be performed before the actual expression will be evaluated, hence only once per chart and not considering the dimension. It's only considering user selection state.


If you need the max version per dimensional value, you can for example use FirstsortedValue:


FirstSortedValue( {$<Product=,Scenario={'Actual'} >} Amount, -Version)


Or if you want to find the max version of Scenario Actual, you can use a set expression within the dollar sign expansion;


Sum({$<Product=,Scenario={'Actual'},Version={"$(=Max({<Scenario = {'Actual'}>} Version))"}>} Amount)