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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between two fields

Hi all!

I have a challange that I don't know have to solve. I would like to get the percentage difference between two fields, Duration_Plan och Duration_Fact.

They are from two different tables that use the key Activity_ID to connect and I need to use two different date fields to get the right value for a specific year, month or week. There is no problem to create two tables to get the values I would like to find the difference between, see attached picture. Hope you get what my issue is.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Bjorn,

Why dont you use ActiveID and YearMonth as the key to join the two tables and then you can subtract the two fields in the backend itself. If it doesn't solve your issue do you mind attaching a sample qvw with some sample data and the fields of interest.

Thanks

AJ

View solution in original post

4 Replies
Not applicable
Author

Hi Bjorn,

Why dont you use ActiveID and YearMonth as the key to join the two tables and then you can subtract the two fields in the backend itself. If it doesn't solve your issue do you mind attaching a sample qvw with some sample data and the fields of interest.

Thanks

AJ

Not applicable
Author

Hi AJ,

Do you mean that I should create a key like "Activity_ID &'|'& Start_Date as Activity_Date" in the script?

Not applicable
Author

Yes Bjorn. Please try that and see if it gives you the expected results. The reason to add dates to it is to make it unique as each ActivityID could have multiple data and will cause duplicates if not used.

Not applicable
Author

Thanks for the good advice AJ!