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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue with calculated dimension

Hi there,

I have two field which represent years. I want to create an histogram from this two field. To do that I created the below calculated

dimension :

aggr( NUM_ANNEE, num_annee

The problem is, when I select Two years, I get an average (only one bar in the histogram) whereas I would like to get 2 bars : one for each year.

Please find attached a screenshot.

Thak you for your help.

7 Replies
abeyphilip
Creator II
Creator II

Hi Anth,

Wouldn't making the year as dimension helps?

Regards,

Abey

CELAMBARASAN
Partner - Champion
Partner - Champion

You should use Year as dimension instead of aggr( NUM_ANNEE, num_annee )

Not applicable
Author

No, it doesn't work because if I put only one year as a dimension, the other is not taking into account.

I need to get a bar for num_annee=2009 and NUM_ANNEE=2009, another for num_annee=2010 and NUM_ANNEE=2010 ect..

I'm pretty sure I should use a calculated dimension and the aggr function but I don't know exactly how..

abeyphilip
Creator II
Creator II

What if you add them as separate dimensions? Something like the attachment.

Rgds

Abey

Not applicable
Author

It's not what I want. In your way, I get 2 bars for 2009, 2 bars for 2010... And I want only one bar for each but which take into acount both sélections..

Not applicable
Author

No one?

abeyphilip
Creator II
Creator II

In the example I posted before, I can see both the dates are considered for each expr value when you do a mouse over.

Is it possible to post a qvw with sample data (inline loads) - I will try to work on that.

If not me, it will help others also to work on the issue.

regards,

Abey