Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

denny_wu
New Contributor

Data Reload

Hi There,

I need help from you guys.

i have table something like this:

before.png

RecipeKey related with SpecKey. so, i want to add new column (column name is "Key). that Key value should be first row of SpecKey.

before.png

how to build that script ?

Thanks

Denny Wu

3 Replies

Re: Data Reload

Hi Denny, in script you can do a sorted reload and use Peek() to propagate the value:

https://help.qlik.com/en-US/sense/April2018/Subsystems/Hub/Content/Scripting/InterRecordFunctions/Pe...

If(IsNull(Peek('Key')), Description, Peek('Key')) as Key

Usually you need to group values to 'reset' the propagated value, if not all rows will have the same value.

If(GroupCode<>Peek('GroupCode'), Description, Peek('Key')) as Key

denny_wu
New Contributor

Re: Data Reload

What do you mean Group values ?
i dont see can group the values, cause all row is related with column RecipeKey.

Re: Data Reload

Just that usually the value changes on some conditions, like taking the first value of each year, if you want the same value in all rows it doesn't matter. It was only an example.