Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ilyakoch
New Contributor

Filter two exaclly same tables with diferent date filters

Hello .

I just start to work with Qlik Sence  and i have a Issue i need to solve .

I have table with 1 dimention and 4 measures .

The table is duplicated in same work sheet , first copy filtered by date from filter pane , second must be filtered

from start of year to date what selected in filter pane .

how i can do the second request ? 

Thank you for your attention

Tags (2)
5 Replies

Re: Filter two exaclly same tables with diferent date filters

Hi Ilya, if DateField is the field used to filter, the second can be:

Sum({<DateField={">=$(=Num(Monthstart(Max(DateField))))<=$(=Max(DateField))"}>} Sales)

ilyakoch
New Contributor

Re: Filter two exaclly same tables with diferent date filters

Ruben thank you for your reply

my date filter have two feild YEAR and MONTH i try to write something like

COUNT ({$<Year={GetFieldSelections(Year)}>*<Month= {Max(Month)>}SALES )

But it doesnt work .

ilyakoch
New Contributor

Re: Filter two exaclly same tables with diferent date filters

also i try script like this

COUNT ({$<Year={2018}>}sales) - work perfect but not a versatile

when i alter my script to COUNT ({$<Year={GetFieldSelections(Year)}>}sales )

I get Error

Re: Filter two exaclly same tables with diferent date filters

Hi, if you want a value from start of the year to date salected, shouldn't it be only one year and the dates to filter from 01/01 to date selected? and is a count of sales (not a sum?)?

There are different possibilities based on what you really want, it can be:

- COUNT ({$<Month={"<=Max(Month)"}>}SALES) // for all years until month selected

- COUNT ({$<Year={$(=Max(Year))}, Month={"<=$(=Max(Month))"}>}SALES) // for max years of seleted

- COUNT ({$<Year={$(=Max(Year))}, Month={"<=$(=Max(Month))"}>+<Year={"<$(=Max(Year))"}>}SALES)

- ...

Also, just to comment that in script you can create a date field based on month and year values:

Makedate(YearField, MonthField) as Date

Khan_Mohammed
Honored Contributor II

Re: Filter two exaclly same tables with diferent date filters

Maybe use an extension?

You'd need Alternate States

Qlik Branch

or

Qlik Branch

Community Browser