Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
This would be on Qlik Sense.
I have 2 columns in a table:
ID Sal
002 879
002
002 876
003
003 543
003
Now I'd like a result which will replace all the values of "Sal", based on the column ID. the result should look like this:
ID Sal
002 879
002 879
002 876
003 543
003 543
003 543
i.e., based on the key column, it would replace the previous "Sal" value for all blank "Sal" values for that ID till it encounters a non blank value. I would like this to happen in the data load editor.
Kindly provide your inputs on this.
Thanks in advance.
you can use previous function something like
if(Sal="",previous(Sal), Sal)
Thanks, But how'd I group it based on ID?
if i understand your statement correctly... define Sort order , id and Sal so that id's are grouped together and a non null sal comes first
Hi Dilip,
It is difficult to group the values in an order where non null sal comes first in my actual problem as it has to be sorted on a time series basis. That is the point where I'm stuck,
Using the previous function I was successful in achieving one iteration. however in case of multiple iterations, a looping would be required. Not so confident on how the loops are used.
your inputs on similar lines would be appreciated.
Thanks in advance.
i think i understand the problem.
think it might need soemthing a bit more convoluted. not sure i can help without access to the app.
very very (possibly unnecessarily) complicated way i can think off not knowing your app
e.g. you load the data into a temp table and which conforms to the logic you want for the first non null value. create a map from this. use that for the actual table load