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

Set analysis to compare one field value with another

Hi Folks,

I've a small requirement to write set analysis expression to get the values by comparing one field value with another.

Screenshot.PNG
For the fields country_id,year_id,measure_id,scenario_id I need to derive the measure based on the measure_value.

eg: for Country=25,year=11,measure=32,scenario=1,2,3 the applicable scenario is 1 . Hence the derived measure value should be 12 which is the measure value for scenario 1.

Similarly for country=25,year=114,measure=32,scenario=1,2,3 the applicable scenario is 2. Hence the derived measure value should be 27 which is the measure value for scenario2.

Can any one help me to write the expression to derive the measure.

Thanks,

Surendra

4 Replies
Not applicable
Author

I think It should be:

Only({<scenario={$(Only([Applicable Scenario]))}>}TOTAL<scenario> measure_value)

Where your dimensions should be:

Country, Year, measure and scenario.

Anyway, I think it would be better choice to calculate that field in the script.

Not applicable
Author

No IOSU,

The expression didn't return any thing.

Thanks,

Surendra


Not applicable
Author

My fault. It was:

Only({<scenario={$(=Max([Applicable Scenario]))}>}TOTAL<country, year, measure> measure_value)

Not applicable
Author

PFA: