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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
NoelMinet
Contributor
Contributor

Soustraction dans un KPI

Bonjour à tous,
je fais face à un petit problème mathématique dans Qlik Sense :
ma formule : 

([Invoicing Amount CYTD] - COST_AMOUNT)
-
([Invoicing Amount PYTD] - ({<YEAR = {"$(=MAX(YEAR)-1)"}>} COST_AMOUNT))

En décomposant, j'obtiens -2.43 et -2.10 

si je fais le calcul de tête (-2.43) - (-2.10) = -0.33
si je laisse Qlik gérer : 1.15

>_<
si je passe par des variables 
v1 = ([Invoicing Amount CYTD] - COST_AMOUNT)
v2 = ([Invoicing Amount PYTD] - ({<YEAR = {"$(=MAX(YEAR)-1)"}>} COST_AMOUNT))
Et que je lui demande v1-v2 => -0.33

Qu'ai je loupé ?

 

 

Labels (1)
1 Reply
BIAKS
Creator
Creator

I am not really sure but I think it is about set analysis. In the first expression it also filter data for first measures: Invoicing_Amount_CYTD and COST_AMOUNT.
And maybe that change gives the different result.
In variables, the set analysis only work for last measures: Invoicing_Amount_PYTD and COST_AMOUNT.