Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
stefano_bianche
Contributor II
Contributor II

Fields comparison

Hi all!

I need information about an error caused by a comparison on two fields.

the formula I used is the following:

if(Sum(Fatturato) <>  sum(AdHoc_TotaleFattura), 'Totale Diverso', 'Totale Uguale')

My problem is that on equal values 0 ​​it does not bring me 'Totale Uguale' but 'Totale Diverso' (I attach the table).

I also carried out a CAST on both indicted fields (DECIMAL (10.2)) but I can not fix the situation.

Can you give me a hand?

Thank you all

1 Solution

Accepted Solutions
sunny_talwar

Or this

If(Round(Sum(Fatturato), 0.01) <> Round(Sum(AdHoc_TotaleFattura), 0.01), 'Totale Diverso', 'Totale Uguale')

View solution in original post

2 Replies
sunny_talwar

May be this

If(Round(Sum(Fatturato)) <> Round(Sum(AdHoc_TotaleFattura)), 'Totale Diverso', 'Totale Uguale')

sunny_talwar

Or this

If(Round(Sum(Fatturato), 0.01) <> Round(Sum(AdHoc_TotaleFattura), 0.01), 'Totale Diverso', 'Totale Uguale')