Qlik Community

Qlik Sense App Development

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


Increase Count on Condition in Load Script

Hi Guys,

I have assign Key to raw data that i have as below, the value should be same till the value is Query.

So in Below Table when the Value is Query it should assign new Key For example 1 for Card Object and Event it would remain same than again when it encounters "Query" it becomes 2

EventABC-10/01/2019 15:42
ObjectABC-10/01/2019 15:42
CardABC-10/01/2019 15:42
QueryABCFlynn10/01/2019 15:43
EventXYZ-10/01/2019 11:43
ObjectXYZ-10/01/2019 11:43
CardXYZ-10/01/2019 11:43
QueryXYZDAN10/01/2019 11:43


Can you please help how i can achieve this in Load script.

4 Replies

Re: Increase Count on Condition in Load Script

Not clear what you mean.
Can you show the desired output

Re: Increase Count on Condition in Load Script

May be this

	 RowNo() as RowNum,
	 If(Value = 'Query', RangeSum(Peek('Key'), 1), Alt(Peek('Key'), 1)) as Key;
    Value, User_Account, Search, Time
    Event, ABC, -, 10/01/2019 15:42
    Object, ABC, -, 10/01/2019 15:42
    Card, ABC, -, 10/01/2019 15:42
    Query, ABC, Flynn, 10/01/2019 15:43
    Event, XYZ, -, 10/01/2019 11:43
    Object, XYZ, -, 10/01/2019 11:43
    Card, XYZ, -, 10/01/2019 11:43
    Query, XYZ, DAN, 10/01/2019 11:43

Re: Increase Count on Condition in Load Script

Thanks for Reply yes like this, but when i am applying to me data it is incorrect for couple of rows.PFA

It has assigned same Key("3") to 2 different user search

priya-Card2019-01-11 05:203  
priya-Card2019-01-11 11:5910  
priya-Card2019-01-11 12:0810  
priya-Card2019-01-11 13:0510  
priya-Card2019-01-11 14:4218  
priya-Card2019-01-11 14:4320  
58537*Search2019-01-11 11:371  
58537*Search2019-01-11 11:432  
58537danielSearch2019-01-11 11:463  
58537-Card2019-01-11 11:463  

Re: Increase Count on Condition in Load Script

This data looks different than the one we started with... that one we were looking for the word Query... what are we looking for in here?