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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
marieclaire
Creator
Creator

Dual function / syntax set analysis

Hi everybody,

I have problems with the syntax of "dual".

This expression works :

dual(num(sum([SRCES Visites])/sum(TOTAL <Année> [SRCES Visites]),'0%'),sum([SRCES Visites]))

I need to use it in an histogram chart, with the two last years.

First I tried with 2015 and 2016, but it does not work :

dual(num(sum([SRCES Visites])/

sum(TOTAL {<Année = {2015,2016}>} <Année> [SRCES Visites]),'0%'),sum([SRCES Visites]))

Any idea ?

Thank you for your help.

2 Replies
sunny_talwar

May be add the set analysis before TOTAL <Field> or after?


Dual(Num(Sum([SRCES Visites])/

Sum({<Année = {2015, 2016}>} TOTAL <Année> [SRCES Visites]),'0%'), Sum([SRCES Visites]))

or

Dual(Num(Sum([SRCES Visites])/

Sum(TOTAL <Année> {<Année = {2015, 2016}>} [SRCES Visites]),'0%'), Sum([SRCES Visites]))

and may be you need this in other places also?

Dual(Num(Sum({<Année = {2015, 2016}>} [SRCES Visites])/sum(TOTAL <Année> {<Année = {2015, 2016}>} [SRCES Visites]),'0%'), Sum({<Année = {2015, 2016}>}[SRCES Visites]))

marieclaire
Creator
Creator
Author

Thank you very much Sunny.

The third one is the good one 😉

Dual(Num(Sum({<Année = {2015, 2016}>} [SRCES Visites])/sum(TOTAL <Année> {<Année = {2015, 2016}>} [SRCES Visites]),'0%'), Sum({<Année = {2015, 2016}>}[SRCES Visites]))

Best regards,