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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Function IF or IF in expression

Hello i have a problem with my expression "if or if" maybe you can help me :

i try to calculate an expression with this :

if([Site Facture]= 'PX', (CMSPSX*Qte), [Site Facture]) or if([Site Facture]= 'FV', (CMSFV*Qte), [Site Facture])

but my results is "-1" and i don't know why.

Maybe you can help me ?

I have join an exemple of my problem

Best regards

1 Solution

Accepted Solutions
Not applicable
Author

i have solve my problem with this expression :

If( Site_Facture = 'PX',

sum(CMS*(Qté_Facturé*Coef_UV_US)),

  if( Site_Facture = 'FV',

   sum(CMSFV*(Qté_Facturé*Coef_UV_US))

     ))

The problem was the labels, don't working on my function. I have use the full operation.

View solution in original post

5 Replies
sunny_talwar

May be this?

if(Match([Site Facture], 'PX', 'FV'), (CMSPSX*Qte), [Site Facture])

sfatoux72
Partner - Specialist
Partner - Specialist

Use :

Rangesum(if([Site Facture]= 'PX', (CMSPSX*Qte), [Site Facture]), if([Site Facture]= 'FV', (CMSFV*Qte), [Site Facture]))

Not applicable
Author

i have solve my problem with this expression :

If( Site_Facture = 'PX',

sum(CMS*(Qté_Facturé*Coef_UV_US)),

  if( Site_Facture = 'FV',

   sum(CMSFV*(Qté_Facturé*Coef_UV_US))

     ))

The problem was the labels, don't working on my function. I have use the full operation.

sfatoux72
Partner - Specialist
Partner - Specialist

or simply :

Rangesum((CMSPSX*Qte), (CMSFV*Qte))

Rangesum manage null value

sfatoux72
Partner - Specialist
Partner - Specialist

Or better:


Rangesum(CMSPSX, CMSFV) * Qte