Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
geoffrey59
Contributor II
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. 

Thanks for your help

Labels (2)
1 Solution

Accepted Solutions
Kushal_Chawda

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

View solution in original post

3 Replies
bramkn
Partner - Specialist
Partner - Specialist

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.

Kushal_Chawda

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

geoffrey59
Contributor II
Contributor II
Author

Hello,

This approch is really more simple that mine.

it's work fine.

Thanks for help.