# Qlik Sense App Development

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for
Did you mean:
Highlighted
Contributor II

## Dual value as number comparaison in setAnalysis

Hello,

i have a problem with a "simple" set analysis.

In my data i have create a flag as Dual value :

• Saison A = 7
• Saison B = 6
• Saison C = 5

In a simple table graph, i want show 2 columns :

• the sum of mesure from the "Actual Saison"
• and the sum of the "Previous Saison".

if the user selection is "Saison B", i want to show the sum from "Saison A"

My set analysis is like this :

Sum({1<[Saison]={[Saison]-1}>} [Total of sales])

This expression not work.

I have read this post for adapt it to my case, but dont work : https://community.qlik.com/t5/QlikView-App-Development/Set-Analysis-Trouble-with-Dual-Field/td-p/586...

I understant the Dual concept . The value is numeric, and the text is only for visualisation.

But, the set analysis dont work with number. Only a text value work in my case.

Labels (2)

• ### Set Analysis

1 Solution

Accepted Solutions
Highlighted
MVP

Dual field will be used to sort the field but you won't be able to perform any aggregation function or any arithmetic operation.

Instead create separate  field which just holds the Number representation for each text then you can write the below expression

=sum({<Saison, ID= {"\$(=max(ID)-1)"}>}[Total of sales])

here, ID field just holds the number

3 Replies
Highlighted
Partner

why do you want a Dual for a flag field? Flags are usually only used in functions so no reason to really have a text value for it. Also you can create an extra field with the text value to seperate the values for real. and then just use the flag(numeric) instead of the dual.

Highlighted
MVP

Dual field will be used to sort the field but you won't be able to perform any aggregation function or any arithmetic operation.

Instead create separate  field which just holds the Number representation for each text then you can write the below expression

=sum({<Saison, ID= {"\$(=max(ID)-1)"}>}[Total of sales])

here, ID field just holds the number

Highlighted
Contributor II

Hello,

This approch is really more simple that mine.

it's work fine.

Thanks for help.