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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Hi, i am having trouble getting the syntax right for set analysis if somebody could help please?

I want to return the expression =$(vPriMeasure_1_Value) but only where Dimension DIO is equal to Direct

Many Thanks

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

There is something missing, the value to compute:

you can write

Sum({$ <myDimension={'DIO'}>} valueToCompute)

let me know

Not applicable
Author

Hi Marc,

Try Using the below Expression;

Only({<DIO={'Direct'}>}vPriMeasure_1_Value)

You may modify the Aggregation as per your need.

Hope it helps.

Cheers !

reshmakala
Creator III
Creator III

Based on current selections, the expression can be

=Only({$<DIO={'Direct'}>}vPriMeasure_1_Value)

Not applicable
Author

Ive tried all 3 of the solutions posted and non are working, it just returns a - in the column in the table. Do you because its using a variable?

alexandros17
Partner - Champion III
Partner - Champion III

My solution is not using a variable, you cannot use it in a sum in that way, if Sum is the correct function, the question is what do you want to sum with the condition you have described?

Sum({$ <myDimension={'DIO'}>} valueToCompute)

Replace myDimension with your dimension and valueToCompute with the value you need to sum

jpapador
Partner - Specialist
Partner - Specialist

Depending on the definition of your variable you may need to use the $ expansion:

Only({$<DIO={'Direct'}>}$(vPriMeasure_1_Value))


Is the expression =$(vPriMeasure_1_Value) working without the set analysis?

Not applicable
Author

unfortunately that doesnt work, and yes it does calculate correctly without set analysis

it seems the expression sum(CD2MAPD_COST) brings back the same value as =$(vPriMeasure_1_Value)


so ive tried Sum({$ <DIO={'Direct'}>} CD2MAPD_COST) and so far that seems to be working ok.

Thank you all for your help - much appreciated!