Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
Creator III
Creator III

Difference Querry

Hi,

I've attached the qvw and data file.

I want to differentiate between months and want to get Rupees in Debit/Credit amount, but I'm getting wrong data.

Can anyone help me on this?

1 Solution

Accepted Solutions
rubenmarin

That will sum the value from the first column with the value in the second column.

Note that's not a difference, is an accumulation, ie:

Jan Feb TOTAL

10   15   25

-10  5     -5

View solution in original post

19 Replies
Kushal_Chawda

What is the output needed?

rubenmarin

Hi Murali, I didn't see any error, can you detail where is the wrong data?

Not applicable

Your alternate states expressions are good. May be with issues with you have negative rupees values in your data.

You may try : fabs(fabs(column(1))-fabs(Column(2))) for your difference column.

Whats was desired out put you are expecting ?

Gysbert_Wassenaar

Looks perfectly fine to me. What's wrong about the data?


talk is cheap, supply exceeds demand
MuraliPrasath
Creator III
Creator III
Author

Example:

Feb we don't have Cloths   0

Jan we have          Cloths  - 25  this is Credit

so Total Difference           =  -25

rubenmarin

OK, I think the problem is when you want to do:

Column(2)-column(1)

or

Column(1)-column(2)

I think that you need to load months also in number so you can make a comparison before decide the formula, something like:

If(SelectMonth<CompareMonth, Column(2)-column(1), Column(1)-column(2))

Gysbert_Wassenaar

No, it's not. The difference between 0 and -25 is 25, not -25.


talk is cheap, supply exceeds demand
trdandamudi
Master II
Master II

I don't see any issue... Everything looks perfect..

MuraliPrasath
Creator III
Creator III
Author

In Feb No money Rupees = 0

In Jan we had Credit amount = -25

if we do difference still we get -25 only right?