Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created Calculated Dimension in QlikSense , but I got error message for Invalid Dimension. I am trying to create a Line chart that represent the number of projects by working days by year, so:
1- My first dimension is working year
2- My second dimension is an expression to get the numbers of working days by year, but it's not working not sure why? Here is the expression
= If(count(Distinct WorkingDate) = 1, '1',
If(count(Distinct WorkingDate) = 2, '2',
If(count(Distinct WorkingDate) = 3, '3',
If(count(Distinct WorkingDate) = 4, '4',
'+5'))))
3- My Measures is the Count of ProjectId
so I should have a chart that looks like this:
Thank you for your time
try this.
aggr(If(count(Distinct If(IsPrepDate =0,WorkingDate)) = 1, '1',
If(count(Distinct If(IsPrepDate =0,WorkingDate))= 2, '2',
If(count(Distinct If(IsPrepDate =0,WorkingDate)) = 3, '3',
If(count(Distinct If(IsPrepDate =0,WorkingDate)) = 4, '4',
'+5')))),ProjectId)
Enclosed the expression in another expression called aggr, like below.
=aggr(If(count(Distinct WorkingDate) = 1, '1',
If(count(Distinct WorkingDate) = 2, '2',
If(count(Distinct WorkingDate) = 3, '3',
If(count(Distinct WorkingDate) = 4, '4',
'+5')))),ProjectId)
Awesome, thank you so much. I also want to add a new condition to this expression by counting the distinct work days only if the prepDate is equal to zero, I tried to do it in this way but is not giving the right answer:
=aggr(If(IsPrepDate= 0 and count(Distinct WorkingDate) = 1, '1',
If(IsPrepDate= 0 and count(Distinct WorkingDate) = 2, '2',
If(IsPrepDate= 0 and count(Distinct WorkingDate) = 3, '3',
If(IsPrepDate= 0 and count(Distinct WorkingDate) = 4, '4',
'+5')))),ProjectId)
try this.
aggr(If(count(Distinct If(IsPrepDate =0,WorkingDate)) = 1, '1',
If(count(Distinct If(IsPrepDate =0,WorkingDate))= 2, '2',
If(count(Distinct If(IsPrepDate =0,WorkingDate)) = 3, '3',
If(count(Distinct If(IsPrepDate =0,WorkingDate)) = 4, '4',
'+5')))),ProjectId)
You are the best, thank you so much, That solved my problem