Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In qliksense i have created one calculated dimension using this logic
Days=if(Rep_Field='Current Month By Day',Date_Period), this is giving me number of days such as 1,2,3,4,.....31
Now i have one bar chart where i am using region as 1st dimension and the 2nd dimension (the above one) is the Days.
now i want to last 5 days of data in this chart. so i am using this as expression.
Sum({<Date_Period={‘>=$(=Date(Max(MyDate)-5),'DD')<=$(=Date(Max(MyDate),'DD'))’}>} Val )
MyDate has only one date as =DD/MM/YYYY format.
I am unable to get this to work.
If you want to use your current expression, use this one -
Sum({<Date_Period={">=$(=Date(Max(MyDate)-5),'DD')<=$(=Date(Max(MyDate),'DD'))"}>} Val )
However, since you are using the Max of your date field, the easier expression is this one -
Sum({<MyDate={">$(=Date(Max(MyDate)-5))"}>} Val )
Regards,
Chirag
Hi Chirag,
Thank you for your reply. i see you only change the double quote instead of single quote apart from that the syntax is same.
unfortunately it did not work though.
Date_Period and MyDate coulums are two different colums.
MyDate column will have only one date value and it will take only "DD" part (number of days) and that needs to match with Date_Period columns and get 5 days of data.
So , MyDate will have value like = "MM-DD-YYYY"
and Date_Period will have values like = 1,2,3,4,5,6,7.......31
Thank you,
I tried this following syntax
Sum({<Date_Period={">$(=Date((Max(MyDate)-4),'DD'))"}>} Val ) - this is giving me result however it is incorrect.
it is giving more result that the max date returns. For example max(MyDate) has value 27-06-2017 , so i want results of
27,26,25,24,and 23.
the above syntax is giving 28, 29,30 and 31 result as well.
Working with date fields is tricky. Could you share a sample app to work on?
Hi Tresesco, Thank you for your reply, actually i can not share the app due to security reason.
You can create an app with representative sample data (removing security concern) and share - that way I guess you would get better and faster resolution.