Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Evaluating the same column and overwriting if condition holds

Hello all,

I have a column named Qty. what i want to do is check the values in that column and overwrite it with new values based on a condition. To further explain my issue:

if (Len(Qty) = 0 OR Qty <= 0)

    Col1 as Qty; //lets call this 1st iteration

if (Len(Qty) = 0 OR Qty <= 0) // here i am checking the previously set values (1st Iteration) of Qty

    Col2 as Qty; //lets call this 2nd iteration

if (Len(Qty) = 0 OR Qty <= 0)// here i am checking the previously set values (2nd Iteration) of Qty

    Col3 as Qty; //lets call this 3rd iteration

and so on...

 

is this possible to do in Qlik? 

 

Thank you.

Labels (4)
3 Replies
Kushal_Chawda

Not sure I understand correctly but you can some how achieve it by checking condition in multiple load

LOAD *,
if (Len(Col2Qty) = 0 OR Col2Qty <= 0,Col3) as Col3Qty;
LOAD *,
if (Len(Col1Qty) = 0 OR Col1Qty <= 0,Col2) as Col2Qty;
LOAD *,
if (Len(Qty) = 0 OR Qty <= 0,Col1) as Col1Qty
FROM Table;
waleeed_mahmood
Creator
Creator
Author

Hi Kush,

I see you are making additional columns. Is it possible to assign values to the same column or maybe combine Col1Qty, Col2Qty and Col3Qty into Qty after calculating them?

Kushal_Chawda

Technically yes. You need to concatenate all load statement of your Data keeping same Column name. But it will be better if you can post some sample data with expected output then you will get a better solution.