I have granularity calculated field in my dataset:
ifelse(
${Granularity} = ‘Day’, truncDate(‘DD’, {t_created_date}),
${Granularity} = ‘Week’, truncDate(‘WK’, {t_created_date}),
${Granularity} = ‘Month’, truncDate(‘MM’, {t_created_date}),
${Granularity} = ‘Year’, truncDate(‘YYYY’, {t_created_date}),
truncDate(‘MM’, {t_created_date}) // This is the default result if no other condition is met
)
when I implemented granularity filtering (control), then I can select day option, but the graph does not show the date info, only month info every day as shown in the screenshot
could you please clarify how can I have proper filtering for that?
Hi @Tamerlan_Damirbayli,
Just to confirm, can you please let me know what field you have for your X-axis? If it is “t_created_date”, I would recommend switching the X-axis to your granularity calculated field, as that should change the granularity based on the control. If you already have it this way and it does not work, please let me know and we can explore other workarounds!
Thank you!
1 Like
Hi @WLS-Luis
thanks for your reply
yes, the filtering is on granularity calculated field.
if there is generic information how to do so, pls let me know. otherwise, it seems it is not resolvable in my dashboard
It seems the graph produces the correct info. As I see for Day on Granularity it shows 31 bar for Jan followed by days in Feb. Check the Format of field used in bar chart.
Also, to test it better convert and just use that field in table and then update the controls with Format set to auto.
I have used the same calculation as given above (in your initial thread) in Selected Timeframe (field in my visual). If that still does not work. Copy the formula and create another calculated field and remove the currently used field and use the new one. Do not replace it may copy over the formatting. In short, to me this is a formatting issue.
2 Likes
thanks a lot, creating totally new calculated field with the same function worked well
1 Like
@pulakuma @WLS-Luis
hi both,
is there any video, instruction for this filtering?
I had another field with granularity and it does not work
another field script is as follows:
sum(
ifelse(
{t_status} = 'AUTHORIZED' or {t_status} = 'COMPLETED',
1,
0
)
) / count({t_status})