Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ilyakoch
Contributor II
Contributor II

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

5 Replies
rubenmarin

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

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

ilyakoch
Contributor II
Contributor II
Author

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
Contributor II
Contributor II
Author

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

rubenmarin

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

MK9885
Master II
Master II

Maybe use an extension?

You'd need Alternate States

Qlik Branch

or

Qlik Branch