Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
sunny_talwar

Try this

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

View solution in original post

11 Replies
arulsettu
Master III
Master III

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

Anonymous
Not applicable
Author

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

arulsettu
Master III
Master III

can you share your set analysis

Anonymous
Not applicable
Author

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
Master III
Master III

can you share sample

arulsettu
Master III
Master III

Try this


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

sunny_talwar

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

Anonymous
Not applicable
Author

Thank you arul settu, but it didn't work

Anonymous
Not applicable
Author

as a Date