Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Still Can't figure out QlikSense Histogram

I have done everything I can possibly find on the forums to try and use the QilkSense Histograms, but for some reason I cannot get it to work.

I have Data like this:

Project ID      Year          Quarter          Expense

      1              2018               1                    4

      1              2018               2                    3

      1              2018               3                    1

      1              2018               4                    1

      1              2017               1                    5

      1              2017               2                    2

      1              2017               3                    1

      1              2017               4                    5

      2              2018               1                    4

      2              2018               2                    3

      2              2018               3                    1

      2              2018               4                    1

      2              2017               1                    5

      2              2017               2                    2

      2              2017               3                    1

      2              2017               4                    5


I want a histogram of total Expense by project for just the year 2018.


This was my best guess for a dimension

aggr(Sum( {$<[Year]=2018>}[Expense]), Project ID)


But I get a "This Chart is not displayed because it contains only undefined values"


Any ideas why this is not working?

11 Replies
kundan_ghosh
Contributor II
Contributor II

For my earlier QVF, you can move the Frequency to Y-axis under the appearance settings. I have also modified the frequency expression to =Class(Aggr(Sum({1<Year = {2018}>}Expense),Project_ID),1).

capture.PNG

Revised QVF attached.

On your thought about using histogram, I don't think that is suitable for your use case. Histogram is used for a DIMENSION that is a continuous number e.g. age and NOT for a measure that needs to be aggregated such as Sum(Expense). Qlik help has this to say about histogram "You can only apply a single dimension to a histogram. The dimension must be a numerical field. Histograms do not need a measure, as the frequency of the binned data is automatically calculated."

I still think Class function is what you need. You can play with the arguments of this function to get what you desire.

RichardY
Contributor
Contributor

in response to  

As soon as you put an aggregation into the express histogram fails. But there is a work around

I wanted a histogram of [US Momentum] relative to a particular value like this

=[US Momentum]-sum({<[Portfolio Name]={'R1000'}>} [US Momentum])

but this fails because of the aggregation (I guess)

But if I define a variable

BmkMom=sum({<[Portfolio Name]={'R1000'}>} [US Momentum])

then do my histogram on this

=[US Momentum]-BmkMom

its fine

Personally this looks like a bug. Im new to Qlik and starting to find all sorts of odd behaviours and limitations, so perhaps it just that Im not up to speed yet