Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comment faire un calcul à partir d'un choix dans un volet de filtre ?

Bonjour,

J'ai deux tables sans relation dans Qlik (je simplifie l'exemple mais dans le vrai contexte il m'est impossible de réaliser une relation).

L'une d'elle contient des dates et un champ TestNumMois qui contient le numéro du mois de la date correspondante.

La seconde table contient un champ AVenteSession avec des chiffres et une colonne NumMois qui contient des numéros de mois.

J'ai fait un volet de filtre basé sur la première table qui m'affiche les mois.

Je souhaiterai lorsque je choisis un mois avoir le total du mois correspondant de ma seconde table.

Si je réalise ce calcul :

sum({<NumMois={5}>}AVenteSession)

Cela fonctionne et me renvoie le calcul pour Mai

Mais si je fais :

sum({<NumMois={TestNumMois}>}AVenteSession)

Cela ne fonctionne plus. J'ai essayé tout un tas de syntaxe et impossible de le faire fonctionner. Pourtant si j'affiche dans une zone TestNumMois j'ai bien un chiffre...


Si quelqu'un peut m'aider...

Je vous remercie par avance

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Hi Phillippe,

-1 is true means it's a numeric value, try the below please

sum({<NumMois=p(TestNumMois)>}AVenteSession)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

7 Replies
avinashelite

"NumMouis TestNumMois" is a field or a varaible??

if its a field and your making a single selection then try like this

sum ({< NumMois ={"<=[NumMois TestNumMois]" }>} AVenteSession)

vinieme12
Champion III
Champion III

Hi Philippe,

This really Seems like a data type mismatch issue.

Are  TestNumMois  values like 05,06,07? They should be 5,6,8.


There is no problem with your expression the field TestNumMois  i think is coming in as a text value, that's why it won't evaluate.

Try this to verify please; in a textbox    = IsNum(TestNumMois) ;  if this returns false then TestNumMois  is a text value and you will need to convert this to Num while loading.

Thanks

Vineeth

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Hello,

The both are fields. In each table i have a date and i use MONTH(DateDebut) As NumMois and MONTH(DateDebut) As TestNumMois

But your line doesn't work...

Not applicable
Author

Hello,

The values of TestNumMois are like : 1, 2, 3...

In my table i have a date and i use MONTH(DateDebut) As TestNumMois to obtain this number.

In Qlik, i have done IsNum(TestNumMois) and the result is -1

Is it true or false ?

Thanks for your answer

Philippe

vinieme12
Champion III
Champion III

Hi Phillippe,

-1 is true means it's a numeric value, try the below please

sum({<NumMois=p(TestNumMois)>}AVenteSession)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Yes it works

Thanks a lot

But why p(TestNumMois) ?

Thanks again

Philippe

vinieme12
Champion III
Champion III

Glad to help, ☺

P () is for possible values and e() for exclusions , you can also use them when matching multiple values.

Do read more about its usage https://community.qlik.com/docs/DOC-12533

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.