Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
andrea0901
Creator
Creator

calculated Date dimension field in straight table in qliksense

Hi Experts,

I need to get only the 2022 data from jan to till date in a Date filed which is  a dimension in my straight table. 

i have written the logic in Date dimension as 

=aggr(only({<Date = {">=$(=Yearstart(Max(Date),-3))<=$(=max(Today()))"}>}>}Date),Date)

and showing the result as

andrea0901_0-1652433933879.png

but in the chart it is displaying as hyphen as shown below:

 

andrea0901_1-1652433979910.png

 

 

 

Please assist me on this. Thank you in advance

Labels (1)
2 Replies
vinieme12
Champion III
Champion III

Ideally you should be restricting the measures

 

Calculated Dimension for Jan to Date

=aggr(

only({<

Date = {">=$(=Date(Yearstart(Max(Date))))<=$(=date(max(Today()))) " }

>}  Date)       //  You have extra closing brackets here >} >} 

,Date)

 

 

Best to restrict in measures

Count({<Date = {">=$(=Date(Yearstart(Max(Date))))<=$(=date(max(Today())))  " } ,City={'Tokyo'} >}Distinct Customer)

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
andrea0901
Creator
Creator
Author

hi , As i dont have a measure field , we just pulled all the fields as a dimension in a straight table. and i need to put in date dimension only. i have removed the extra brackets but didnt work