Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rolling 12 days

Hi

I need to create formula that counts a measure the last 12 days.

It should allways be tha last 12 days even if one select other periods from timetable.

I tired this one:

 

=

COUNT(DISTINCT if([Date record was created.] >= date(num(today()) -12) and TO_LOCATION LIKE 'INN_MONO_0*' and ((not([UOM for FROM_QTY.] like 'RC')) and FROM_LOCATION LIKE '1*'),TO_LIC

,0))

My original formula

 

=

COUNT(DISTINCT if(TO_LOCATION LIKE 'INN_MONO_0*' and ((not([UOM for FROM_QTY.] like 'RC')) and FROM_LOCATION LIKE '1*'),TO_LIC

,0))

Please advise.

Thanks for your time.

BR

Dan

1 Solution

Accepted Solutions
Gysbert_Wassenaar

[FROM_LOCATION] = {'2*'} or [FROM_LOCATION] = {'2*'}

These two conditions are identical so you need only one

But if you want something like [FROM_LOCATION] = {'2*'} or [FROM_LOCATION] = {'6*'} you can use [FROM_LOCATION] = {'2*','6*'}


talk is cheap, supply exceeds demand

View solution in original post

13 Replies
alexandros17
Partner - Champion III
Partner - Champion III

The first formula looks good, if it doesn't work pay attention to date format ('DD/MM/YYYY') for example

Sokkorn
Master
Master

Hi Dan,

Let try this (ignor syntax checker)

Count(

    {$<[Date record was created.] = {">=$(=Date(Today()-12))"},

    [TO_LOCATION] = {'INN_MONO_0*'}>},

    [FROM_LOCATION] = {'1*'}>},

    [UOM for FROM_QTY.] -= {'*RC*'}>}

Distinct [TO_LIC])

Hope it help

Regards,

Sokkorn

SunilChauhan
Champion
Champion

Try Below code

count({<[Date record was created.] ={">$(=Date(addmonths(max([Date record was created.]),-12))<={$(=Max([Date record was created.])}"},[TO_LOCATION] = {'INN_MONO_0*'}>},
    [FROM_LOCATION] = {'1*'}>},
    [UOM for FROM_QTY.] -= {'*RC*'}>}
>}Distinct [TO_LIC])

hope this helps

Sunil Chauhan
Qlik__Vinodh
Partner - Creator II
Partner - Creator II

HI i have an issue friend can u help me yarr................

Qlik__Vinodh
Partner - Creator II
Partner - Creator II

Hi Sokkorn,

i am asking u man .i need quarter and previous year-quarter comparision is required,so pls help me .

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Check if the attached helps

Anonymous
Not applicable
Author

Hi

This one seems to go 12 months back, where I would need only 12 days.

Dan

Anonymous
Not applicable
Author

Hi

This one seems to go 12 months back, where I would need only 12 days.

Dan

Anonymous
Not applicable
Author

Hi

This one seems to go 12 months back, where I would need only 12 days.

Dan