I need to create a flag metric in qliksense front (set analysis). This metric needs to mark with 1 when it detects a change in prices and 0 if its the same. The agregation (the line to wactch) is Laboratory, Product, Presentation. These are not in the same table but are related to each other in a "relation" table
Having this data:
Product A, Pres. A, Price 300 (Flag must be 0)
Product A, Pres. A, Price 350 (Flag must be 1)
Product A, pres. A, Price 250 (Flag must be 1)
Product A, pres. A, Price 250 (Flag must be 0) an so on...
The chart im going to create is something like this:
Product |Times it change | Last date of change
A | 2 | 27/10/2023
THANKS!!!!

Added a few more rows to your data set to show how it could work. This script has some hard-coded data and then loads it in sorted and looks up to the previous row to see if it's a change.
That then gives an Output table like this:
Which can then be used to show in the front end like this:
Hope that helps!
I wasn't sure what you meant by the aggregation line being in another table. If you meant that Product & Pres in the example above wouldn't be in the same table then I'd recommend mapping or joining that in first before doing this.