Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

date values restriction

Hello Lovely people,

I am using a date field in one of my graphs, this field contains many years. in my graph, all the years are displayed :

Capture.PNG

I would like to display only 2016 data.  

My date dimension :

=date(Floor([Date création]))

Any idea?

8 Replies
stigchel
Partner - Master
Partner - Master

If your expression is e.g. Sum(Sales) change it to

Sum({<[Date création]={'>=1/1/2016'}>} Sales)

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

Please try this:

In script create this year field:

          year( date(Floor([Date création])) ) as [Year création],

And put this as a field Dimension

=only({$<[Year création] = {2016}>} [Date création] )

Or in your expression add this set analysis in your expression

{$<[Year création] = {2016}>}

Best regards,

Data Architect MB

Anonymous
Not applicable

Create a tag for 2016 Year

Anil_Babu_Samineni

Have you tried

Like dim is date field

And expression is simply call

Sum({<year = {'=$(max(year))'}>} sales)

Or

Sum({<year = {'2016'}>}sales)

Second expression will work, but first expression also can work until you don't have forecast data.

Hope this helpful

And how is your date field format looking

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
master_student
Creator III
Creator III
Author

this is my expression :

=count(if(LONG_DESC_STATUS <> 'Demande traitée FO' AND LONG_DESC_STATUS <> 'Info fournie' AND LONG_DESC_STATUS <> 'Abandonné',CASE_ID ))

master_student
Creator III
Creator III
Author

here's my expression, how to update it :

=count(if(LONG_DESC_STATUS <> 'Demande traitée FO' AND LONG_DESC_STATUS <> 'Info fournie' AND LONG_DESC_STATUS <> 'Abandonné',CASE_ID ))

Anil_Babu_Samineni

Perhaps this

=count({<LONG_DESC_STATUS -= { 'Demande traitée FO', 'Info fournie', 'Abandonné'} >} CASE_ID )


Or this for 2016 data only


=count({<LONG_DESC_STATUS -= { 'Demande traitée FO', 'Info fournie', 'Abandonné'}, year = {'2016'} >} CASE_ID )

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sasikanth
Master
Master

HI,

Shift this date(Floor([Date création])) calculation to script level

Load date(Floor([Date création]))  as Created_Date

also calculate Year(date(Floor([Date création])) ) as YEAR

.

.

FROM Table;

Dimension:

Created_Date

Expression:

count({<LONG_DESC_STATUS={'*'}-{''Demande traitée FO'}, LONG_DESC_STATUS={'*'}-{'Info fournie'},

LONG_DESC_STATUS={'*'}-{'Abandonné'},YEAR={$(=max(YEAR))}>}CASE_ID )


Thanks,