Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Dynamic data in Inline load

Hi all,

Is it possible to add dates in inline load.

For ex: I have a inline load script like below, i need to add a date next to the names is it possible?

Newdims:

INLINE [  Emails

     Invitation Email  (Every Tuesday's Date)

    Reminder1 (signups)  (Every Thursday's Date)

    Reminder1 (non signups)  (Every Thursday's Date)

    Reminder1

    Reminder2 (signups) (Every Friday's Date)

    Reminder2 (non signups) (Every Friday's Date)

    Reminder2

    Final Reminder (signups)  (Every Saturday's Date)

    Final Reminder (non signups)  (Every Saturday's Date)

    Final Reminder

    Totals

];

I am using the above Inline script in table as column, I need to display the date of email sent, i used the date() but it is not working.

Is any way?

regards,

Pramod

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Dynamic data in Inline load

Hi,

Try this script

LET vEveryTuesday = Date(WeekStart(Today()) + 1);

LET vEveryThursday = Date(WeekStart(Today()) + 3);

LET vEveryFriday = Date(WeekStart(Today()) + 4);

LET vEverySaturday = Date(WeekStart(Today()) + 5);

LOAD

Replace(Emails, Chr(39), '') AS Emails

INLINE [  Emails

     Invitation Email  '$(vEveryTuesday)'

    Reminder1 (signups)  '$(vEveryThursday)'

    Reminder1 (non signups)  '$(vEveryThursday)'

    Reminder1

    Reminder2 (signups) '$(vEveryFriday)'

    Reminder2 (non signups) '$(vEveryFriday)'

    Reminder2

    Final Reminder (signups)  $(vEverySaturday)

    Final Reminder (non signups)  $(vEverySaturday)

    Final Reminder

    Totals

];

Regards,

Jagan.

View solution in original post

9 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Dynamic data in Inline load

Hi,

The data which you are loading in Inline is not the transactional data. It is a text, and thus your date function will not work on that.

Kindly share what transaction data columns you have

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Partner
Partner

Re: Dynamic data in Inline load

v = Floor(Today());

NewDims:

load Emails&date($(v)) as Email;

LOAD * INLINE [

    Emails

    Invitation Email

    Reminder1 (signups)

    Reminder1 (non signups)

    Reminder1

    Reminder2 (signups)

    Reminder2 (non signups)

    Reminder2

    Final Reminder (signups)

    Final Reminder (non signups)

    Final Reminder

    Totals

];

Highlighted
MVP
MVP

Re: Dynamic data in Inline load

You need to move the Today() out of the inline portion.Like this:

NewDims:

LOAD Emails & If(Wildmatch(Emails, '*signups*'), ' ' & Today()) As Emails

INLINE

[

  Emails

  Invitation Email

  Reminder1 (signups)

  Reminder1 (non signups)

  Reminder1

  Reminder2 (signups)

  Reminder2 (non signups)

  Reminder2

  Final Reminder (signups)

  Final Reminder (non signups)

  Final Reminder

  Totals

];

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
Not applicable

Re: Dynamic data in Inline load

Thanks a lot jonathan.

I have one more requirement that is can i add different dates instead of today()?

for example : Invitation Email-  we will send it on Monday so can i have a date of Monday?

and Reminder1 (signups) on Wednesday so date of Wednesday?

And Every week it should change the date.

And I am Using those Inline values in table as dimensions and matching in measures to have table values like below,

IF(match(Emails , 'Invitation Email'),Only({$<expiration_date = {"$(=date(max({$<batch_meta_data_id={23}>}expiration_date)-7))"},

campaign_group_id={'2'},batch_meta_data_id={'23'},email_type_id = {'44'}>}sent),

IF(match(Emails , 'Reminder1 (signups)'),Only({$<expiration_date = {"$(=date(max({$<batch_meta_data_id={23}>}expiration_date)-7))"},

campaign_group_id={'2'},batch_meta_data_id={'23'},email_type_id = {'2'}>}sent),

IF(match(Emails , 'Reminder1 (non signups)'),Only({$<expiration_date = {"$(=date(max({$<batch_meta_data_id={23}>}expiration_date)-7))"},

campaign_group_id={'2'},batch_meta_data_id={'23'},email_type_id = {'45'}>}sent)

But after using with date this is not matching and values disappeared how can i get back values and also the date in column

Highlighted
MVP & Luminary
MVP & Luminary

Re: Dynamic data in Inline load

Hi,

Try like this

LET vToday = date(today());

NewDims:

LOAD Replace(Emails, chr(39), '') AS Emails

INLINE [  Emails

Invitation Email

    Reminder1 (signups)  '$(vToday)'

    Reminder1 (non signups)  '$(vToday)'

    Reminder1

    Reminder2 (signups) '$(vToday)'

    Reminder2 (non signups)  '$(vToday)'

    Reminder2

    Final Reminder (signups)  '$(vToday)'

    Final Reminder (non signups) '$(vToday)'

    Final Reminder

    Totals

];

$(vScript);

Regards,

Jagan.

Highlighted
MVP
MVP

Re: Dynamic data in Inline load

Do you mean that Invitation Emails should be sent only on Monday and on every Monday?

Should the date always be a future date (ie the next Monday)?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
Not applicable

Re: Dynamic data in Inline load

Thanks for the reply jagan,

I need different dates for each type.

For example:

INLINE [  Emails

     Invitation Email  (Every Tuesday's Date)

    Reminder1 (signups)  (Every Thursday's Date)

    Reminder1 (non signups)  (Every Thursday's Date)

    Reminder1

    Reminder2 (signups) (Every Friday's Date)

    Reminder2 (non signups) (Every Friday's Date)

    Reminder2

    Final Reminder (signups)  (Every Saturday's Date)

    Final Reminder (non signups)  (Every Saturday's Date)

    Final Reminder

    Totals

];

And I am Using those Inline values in table as dimensions and matching in measures to have table values like below,

IF(match(Emails , 'Invitation Email'),Only({$<expiration_date = {"$(=date(max({$<batch_meta_data_id={23}>}expiration_date)-7))"},

campaign_group_id={'2'},batch_meta_data_id={'23'},email_type_id = {'44'}>}sent),

IF(match(Emails , 'Reminder1 (signups)'),Only({$<expiration_date = {"$(=date(max({$<batch_meta_data_id={23}>}expiration_date)-7))"},

campaign_group_id={'2'},batch_meta_data_id={'23'},email_type_id = {'2'}>}sent),

IF(match(Emails , 'Reminder1 (non signups)'),Only({$<expiration_date = {"$(=date(max({$<batch_meta_data_id={23}>}expiration_date)-7))"},

campaign_group_id={'2'},batch_meta_data_id={'23'},email_type_id = {'45'}>}sent)

But after using with date this is not matching and values disappeared how can i get back values and also the date in column

Highlighted
MVP & Luminary
MVP & Luminary

Re: Dynamic data in Inline load

Hi,

Try this script

LET vEveryTuesday = Date(WeekStart(Today()) + 1);

LET vEveryThursday = Date(WeekStart(Today()) + 3);

LET vEveryFriday = Date(WeekStart(Today()) + 4);

LET vEverySaturday = Date(WeekStart(Today()) + 5);

LOAD

Replace(Emails, Chr(39), '') AS Emails

INLINE [  Emails

     Invitation Email  '$(vEveryTuesday)'

    Reminder1 (signups)  '$(vEveryThursday)'

    Reminder1 (non signups)  '$(vEveryThursday)'

    Reminder1

    Reminder2 (signups) '$(vEveryFriday)'

    Reminder2 (non signups) '$(vEveryFriday)'

    Reminder2

    Final Reminder (signups)  $(vEverySaturday)

    Final Reminder (non signups)  $(vEverySaturday)

    Final Reminder

    Totals

];

Regards,

Jagan.

View solution in original post

Highlighted
Not applicable

Re: Dynamic data in Inline load

Thanks a lot jagan