Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
absekrafi
Creator III
Creator III

Wrong data when using sum()

Dear community,

I have a table containing a STOCK field.

I added a text object to debug my application:

=Only({<TRANSACTION_DATE = {'$(vStartDate)'}>} If('$(vStartDate)' <= '$(vEndDate)', STOCK, 0))

>> Gives me the correct value.

=Sum({<TRANSACTION_DATE = {'$(vStartDate)'}>} If('$(vStartDate)' <= '$(vEndDate)', STOCK_CONS, 0))

>>  Gives a wrong value.

Could please explain to me the difference between the 2 expressions above.

and what is the meaning of the function Only?


Best regards,

Abdallah

12 Replies
absekrafi
Creator III
Creator III
Author

Hi Chris,

What if the results are good in a straight table and not in a pivot table with the same formula?

Best regards,

Abdallah

chrismarlow
Specialist II
Specialist II

Hi Abdallah,

I would be a bit surprised, If you add fast change option (on general tab) & switch between the two types (pivot & straight tables) does that show any discrepancy?

Regards,

Chris.

absekrafi
Creator III
Creator III
Author

Hi Sunny,

I added a new field to each table when I use JOIN. it is "recno()". This adds a record number to every entry of each table when doing a JOIN so that the rows will be different.

The problem is fixed.

Note: I like the new community site!

Regards,

Abdallah