Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
swarnendu
Creator II
Creator II

Problems in script

Hello guys i have facing a problem in script level.

i want to pick value in row using condition. please see my attach file.

i have two filed which name one is opening quantity and one is closing quantity

i will create a calculated filed which name is  NewOpqty.

please see my image file and also see my script if you have any idea then please share with me.

i need this condition if(opening quantity<>0 ,opening quantity,peek(opening quantity)) and also need this condition 

if closing quantity<>0 then peek(closing quantity) or opening quantity.

But some how my condition will not working.


Thanks in advance

Swarnendu.

errh.jpg

11 Replies
Anil_Babu_Samineni

Not sure, I understand your concern. Can you please share sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swarnendu
Creator II
Creator II
Author

Please check my .qvw file

Anil_Babu_Samineni

Which table we need to look?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swarnendu
Creator II
Creator II
Author

The table name is Final_Stock

swarnendu
Creator II
Creator II
Author

I used this condition ....

if( New_MasterCode <> Peek(New_MasterCode) , If( MasterCode <> Peek(MasterCode),  IF( Opening_Qty <> 0 ,Opening_Qty , Peek(NewOpQty) ) ), If(Opening_Qty = 0 ,Peek(Closing_Qty) , Opening_Qty)  )  as NewOpQty,

but its not working

Anil_Babu_Samineni

That means, You are going to call 2 if..else statement using single IF statement? Isn't it?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swarnendu
Creator II
Creator II
Author

Brother i want a new column which is depends on opening qty and closing qty.

i have opening for each new master code which have only one date.

i just need if opening quantity is 0 then its peek opening quantity depend on closing quantity if closing quantity has value then opening is show me the closing value.

swarnendu
Creator II
Creator II
Author

just check in master code='2793' and new master code =' 7268'

and check the filed NewOpQty.


i just want to remove the 0 values  with 3.16 till 5.16


egg.png

sunny_talwar

You complete logic seems to be not right... can you put it in words what this is suppose to do?