Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If condition in Load script

Hi,

Could you please let me know that will below script work properly based on my if condition?

Status:

LOAD

Created_at,

order_status,

Item_staus,

if(Created_at>=$v_Lasmonth and Status = ('pending','exportable','reserved','shipped'),'delivered',order_status) as order_status1

FROM C:\Users\User\Desktop\QvdName.qvd(QVD);

If not please let know how to solve this ?

Best,

Robert

24 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Max,

I'm not sure why you have gone for a temporary table and RESIDENT load in your example.  This could double the duration of that part of the load.  Could you not just do NUM(created_at) inline with the rest of the load?

Steve

fkeuroglian
Partner - Master
Partner - Master

Robert

try,do, mistake

try,do, mistake

try,do, mistake

try,do, mistake

not only ASK for the solution

Not applicable
Author

Thanks Fernando.

After i tried many times, i have been asked solution for my issue as i am not fully aware of QlikView functions.

Best,

Robert

PrashantSangle

Hi Steve,

I agree with what you suggest.

We must avoid RESIDENT load if not necessary, and In this case it can be easily acheive.

But When User made some logic then I never modify his logic .

I always try to help them to acheive there required output w.r.t there logic.

In above case we can Optimized code

Like below

Source:

LOAD created_at,
    
mop,
    
order_status,
    
if(NUM(created_at) >= MonthStart(Today()-30) and order_status ='exportable','delivered',order_status) as order_status1
FROM
[..\Desktop\Order_Status.xlsx]
(
ooxml, embedded labels, table is Sheet1);

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi Max,

You are absolutely right.

I used resident table in my script for my another logic and to do some joins from different tables.

Indeed, this is my first QV Data model development so i didn't care optimization in the beginning as i want complete my logical data model creation then i suppose to do Data model optimization.

Max & Steve - Many thanks for your suggestion.

Have a nice day !  

Best,

Robert