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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Script

Hi All

IAM writing below condition in the edit script just wanted to know if this is correct

The requirement is like consider  dispatch date should be

Publish_date is not empty and  selling_date is empty  to achieve this IAM writing below script

If(isnull(selling_date),publish_date) as dispatch_Date

Thanks in advance

9 Replies
Chanty4u
MVP
MVP

try this

If(IsNull(TRIM(Selling_date)) =  -1, 1,Publish_date)  as Dispatchdate

PrashantSangle

Not understood clearly.

1: Do you want to consider dispatch_date when publish_date is not empty and selling_date is empty as dispatch_date

then

if(isnull(selling_Date) and not isnull(publish_date),dispatch_date) as dispatch_date

2: Do you want to create new field as dispatch_date when publish_date is not empty then publish_date else selling_date as dispatch_Date

then

if(isnull(selling_date),publish_date,selling_date) as dispatch_date

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 🙂
jonathandienst
Partner - Champion III
Partner - Champion III

Do you mean: Use selling date if selling date is not null; use publish date if selling date is null? Then


    Alt(selling_date, publish_date) as dispatch_Date

    or

    Date(Alt(selling_date, publish_date)) as dispatch_Date


https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ConditionalFun...


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
smilingjohn
Specialist
Specialist
Author

Hi Prashant

Hi want to create a field called dispatch_date

Which should consist the below condition  and that is

Consider  publish_date is not empty but selling_date  emtpy ..

Thanks

smilingjohn
Specialist
Specialist
Author

Hi Jonathan

I want to achieve below described scenario

create a field called dispatch_date

Which should consist the below condition  and that is

Consider  publish_date is not empty but selling_date  emtpy ..

Thanks

jonathandienst
Partner - Champion III
Partner - Champion III

>>Consider  publish_date is not empty but selling_date  emtpy ..


Not sure what that means. Is this not what I described in my earlier post?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
PrashantSangle

ok then give can you ans below query to help you better way

1 : If your said condition is true, then which field you want to show as dispatch_date?

2: if not true, then which field you want to show as dispatch_date?


If possible explain with simple example.


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 🙂
sasiparupudi1
Master III
Master III

IF( Len(publish_date)>0 and Len(Trim(selling_date))=0,publish_date) as dispatch_Date

Anonymous
Not applicable

Hi John - Use the below code


If(Not isnull(Publish_date) and Len(Selling_Date) = 0, Publish_date) as Dispatch_Date



Thanks,

Venkata Sreekanth