Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
djbloiss
Contributor III
Contributor III

Expression that will show Cost only when it changed

I have this script, that works, to pull the new cost everytime it changes and the old price, as well as the change.  However, my client wants me to do this in an expression, not a script.  How can I do this in an expression.  Here is my script, so you can see what I am doing:

if(HHSCSAR <> Previous(HHSCSAR), HHSCSAR, 0) as [New Cost],

if(HHSCSAR <> Previous(HHSCSAR), Previous(HHSCSAR), 0) as [Old Cost],

if(HHSCSAR <> Previous(HHSCSAR), HHSCSAR - Previous(HHSCSAR), 0) as [Cost Change],

of course the [Cost Change] is just the subtraction of the other 2 fields, I am just showing it for completeness.

0 Replies