Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Filter not working

 

Let vPre=Peek('QTY',0,'Tab');

Load*,If((QTY)=0,Peek('Test'),QTY) As Test

Resident Tab;

DROP

Table Tab;

I have used this condition to get the previous data  when the value is null but if i use any filter it is showing the same value and its not showing as per the filter

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

You have to use Order By like:

Load*,If((QTY)=0,Peek('Test'),QTY) As Test


Resident Tab Order By Filter, ID;

View solution in original post

9 Replies
Highlighted
Specialist
Specialist

Hi,

You may use below expression. It should be straight forward instead of creating variable and all.

If(QTY=0, Previous(QTY), QTY) as Test

Highlighted
Not applicable

by selecting the filter JONES ID 20 KKR is showing 844 but actually JONES previous data is 45 i.e ID 13 HDJH so how to get this condition

Highlighted

Why not if you write like below try what result you get.

Load

*,

If( QTY = 0,QTY ) As Test

Resident Tab;

DROP Table Tab;

Highlighted
Not applicable

previous(QTY) will only shows the previous value but if there are continous Null value then it displays Null value itself this condition is not what i needed

Highlighted
Not applicable

Tried it

If the value is 0 it showing me 0

and

If there is a value it showing me -

Highlighted
MVP
MVP

You have to use Order By like:

Load*,If((QTY)=0,Peek('Test'),QTY) As Test


Resident Tab Order By Filter, ID;

View solution in original post

Highlighted
Specialist
Specialist

Hi,

If you want your previous data to be displayed based on your selection than you have to handle this in frontend script not in backend. For example, you can use "Above()" function in straight table to achieve this.

If(Above(QTY)=0, Above(QTY,2), Above(QTY))

Highlighted

If you use Order By you have to use all the fields available in the Tab table that you introduce in resident table for group by statements.

Highlighted
MVP
MVP

Not necessarily.