Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comment utiliser une variable comme filtre

Bonjour,

Comment peut on utiliser la variable créée pour filtrer selon le résultat de ma variable dans un set analysis ou un if :

J'entre dans mon expression calculée :

Soit la variable cashouresultat dont le résultat est soit résultat soit investissement

Je veux donc créer deux graphiques, chacun étant filtré sur chaque résultat de la variable dans l'expression suivante (pour le premier graph, j'ai résultat) :

sum({<CASHOURESULTAT={'RESULTAT'}>} account_cost)

Sum({$< CASHOURESULTAT = 'RESULTAT'>}account_cost)

Le grahique s'affiche mais ne filtre pas , j'ai les deux valeurs correspondant au calcul de la variable dans le script (RESULTAT ET INVESTISSMENT)

J'ai également essayé ceci sur base d'un post mais pas de résultat, peut être une erreur de syntaxe ?

sum ({<CASHOURESULTAT={$(=('INVESTISSEMENTS')}>} account_cost))

any idea ?!

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

THe correct syntax is

sum({$ <CASHOURESULTAT={$(myVariable)}>} account_cost)

hope it helps

Not applicable
Author

it does not work : sum({$ <CASHOURESULTAT={$('RESULTAT')}>} account_cost)

My variable is CASHOURESULTAT ;

This variable is calculated in the script if( [accounting_center] = 'INVESTISSEMENTS','CASH OUT','RESULTAT' )

LET CASHOURESULTAT = 'if( [accounting_center] = ' & chr(39) & 'INVESTISSEMENTS' & chr(39) & ',' & chr(39) & 'CASH OUT' & chr(39) & ',' & chr(39) & 'RESULTAT' & chr(39) & ' )'

and can have 2 values : CASH OUT or RESULTAT

I want to calculate the sum of amount (account cost) for each of these values : one graph with CAsh out and on graph with resultat

Thanks for your help !

PhilippeMotillon
Partner - Creator
Partner - Creator

pourquoi ne pas créer un champ dans votre table avec la bonne valeur et utiliser ce champs pour vos calculs.

if [accounting_center] = 'INVESTISSEMENTS' , 'CASH OUT' , 'RESULTAT' as CASHOURESULTAT

et après , vous pouvez utiliser le set analysis

sum({$ <CASHOURESULTAT={RESULTAT}>} account_cost)

Philippe


Not applicable
Author

Je suis absent(e) du bureau jusqu'au 03/06/2013

I am out of the office and get back to you when I return.

Remarque : ceci est une réponse automatique à votre message "[Groupe des

Utilisateurs Francophones] - Re: Comment utiliser une variable comme

filtre" envoyé le 31/5/13 15:26:28.

C'est la seule notification que vous recevrez pendant l'absence de cette

personne.

This message and any attachments (the "message") is

intended solely for the intended addressees and is confidential.

If you receive this message in error,or are not the intended recipient(s),

please delete it and any copies from your systems and immediately notify

the sender. Any unauthorized view, use that does not comply with its purpose,

dissemination or disclosure, either whole or partial, is prohibited. Since the internet

cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS

(and its subsidiaries) shall not be liable for the message if modified, changed or falsified.

Do not print this message unless it is necessary,consider the environment.