Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sofiavaz
Contributor

Issue filtering dates in set analysis

Hi all,

I'm trying to filter a set expression by year. The issue is that the data base only have a field compound by DD-MM-YY (InventoryFrozenInventoryDate).

Does anyone knows what can I do?

Thank you,

Sofia

1 Solution

Accepted Solutions

Re: Issue filtering dates in set analysis

Try this

Sum({<InventoryFrozenOrdType -= {'PRS'}, InventoryFrozenInventoryType = {'FINISH'}, InventoryFrozenStat ={'B'}, InventoryFrozenInventoryDate = {"$(='>=' & Date(YearStart(Max(InventoryFrozenInventoryDate)), 'DD-MM-YY') & '<=' & Date(Max(InventoryFrozenInventoryDate), 'DD-MM-YY'))"}>} InventoryFrozenTon)

11 Replies
arulsettu
Honored Contributor III

Re: Issue filtering dates in set analysis

try creating date field like below

Date(Date#(InventoryFrozenInventoryDate,'DD-MM-YY'),'DD/MM/YYYY') as date

then create year and use it in your set analysis

sofiavaz
Contributor

Re: Issue filtering dates in set analysis

Thank you arul settu. I must do this with set analysis, because I can't change the script.

arulsettu
Honored Contributor III

Re: Issue filtering dates in set analysis

can you share your set analysis

sofiavaz
Contributor

Re: Issue filtering dates in set analysis

Now it's like this

Sum({<InventoryFrozenOrdType-={'PRS'},InventoryFrozenInventoryType={'FINISH'},InventoryFrozenStat={'B'}>}InventoryFrozenTon)

I would like to add someting like year(InventoryFrozenInventoryDate)=[<"$(=max(Year(InventoryFrozenInventoryDate)))">}


Thank you

arulsettu
Honored Contributor III

Re: Issue filtering dates in set analysis

can you share sample

arulsettu
Honored Contributor III

Re: Issue filtering dates in set analysis

Try this


Sum({<InventoryFrozenOrdType-={'PRS'},InventoryFrozenInventoryType={'FINISH'},InventoryFrozenStat={'B'},InventoryFrozenInventoryDate={Year(max(DATE ( Date# ( InventoryFrozenInventoryDate,'DD-MM-YY' ),'DD/MM/YYYY')))}>}InventoryFrozenTon)

Re: Issue filtering dates in set analysis

Does Qlik Sense read InventoryFrozenInventoryDate as Date or does it read as a string?

sofiavaz
Contributor

Re: Issue filtering dates in set analysis

Thank you arul settu, but it didn't work

sofiavaz
Contributor

Re: Issue filtering dates in set analysis

as a Date

Community Browser