# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Contributor II

## 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))

BR

Dan

1 Solution

Accepted Solutions

## Re: Rolling 12 days

 [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
13 Replies
MVP

## Re: Rolling 12 days

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

Honored Contributor

## Re: Rolling 12 days

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

Esteemed Contributor

## Re: Rolling 12 days

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

New Contributor

## Re: Rolling 12 days

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

New Contributor

## Re: Rolling 12 days

Hi Sokkorn,

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

Valued Contributor II

## Re: Rolling 12 days

Hi,

Check if the attached helps

Contributor II

## Re: Rolling 12 days

Hi

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

Dan

Contributor II

## Re: Rolling 12 days

Hi

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

Dan

Contributor II

## Re: Rolling 12 days

Hi

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

Dan