8 Replies Latest reply: Aug 6, 2015 3:09 AM by Per Christian Nødtvedt

# Bell curve changes

Hi all,

hic,

The  discussion Re: Bell curve was helpful.

1)  I was using below script to load the data for 5 minutes time interval:

If(total_time_taken<='00:05:00' ,Dual('00:00-05:00',0),

If(total_time_taken>='00:05:00' and total_time_taken<='00:10:00' ,Dual('05:00-0:10:00',1),

If(total_time_taken>='00:10:00' and total_time_taken<='00:15:00' ,Dual('10:00-15:00',2),

If(total_time_taken>='00:15:00' and total_time_taken<='00:20:00' ,Dual('15:00-20:00',3),

If(total_time_taken>='00:20:00' and total_time_taken<='00:25:00' ,Dual('20:00-25:00',4),

If(total_time_taken>='00:25:00' and total_time_taken<='00:30:00' ,Dual('25:00-30:00',5),

If(total_time_taken>='00:30:00' and total_time_taken<='00:35:00' ,Dual('30:00-35:00',6),

If(total_time_taken>='00:35:00' and total_time_taken<='00:40:00' ,Dual('35:00-40:00',7),

If(total_time_taken>='00:40:00' and total_time_taken<='00:45:00' ,Dual('40:00-45:00',8),

If(total_time_taken>='00:45:00' and total_time_taken<='00:50:00' ,Dual('45:00-50:00',9),

If(total_time_taken>'00:50:00',Dual('>50:00',10)

))))))))))) as time_interval;

but now i need show the data for every 1 minute interval , so i need to hard code like below,

If(total_time_taken>='00:01:00' and total_time_taken<='00:02:00' ,Dual('01:00-02:00',1),

If(total_time_taken>='00:02:00' and total_time_taken<='00:03:00' ,Dual('02:00-03:00',2),

Is their any other way to display without hard coding ?

2)  I need to display the data values of bar in combo chart. how can i done this?

3) I need to disable the selection so, i have using {1}, but how this can be used for below expression: which should be applied for whole expression:

only(Normdist(round(total_time_taken,avgTime),Avg({1<subject_id={'2'},subject_status={'passed','completed'}>}total total_time_taken),

Stdev({1<subject_id={'2'},subject_status={'passed','completed'}>}total total_time_taken),1))

*avgTime*Count({1<subject_id={'2'},subject_status={'passed','completed'}>}total_time_taken)

Thanks,

Pramod

• ###### Re: Bell curve changes

Have you looked at Class()?

What format is your total_time_taken? Assuming it is a proper QV time interval (numeric):

If(total_time_taken <= '00:50:00',        // or 50/(24*60)

Class(total_time_taken, 1 / (24*60)),

Dual('>50:00',51)

) As time_interval;

• ###### Re: Bell curve changes

HI jonathan,

I am getting the values in decimal points.

I have used the script given by ruben. it's working fine.

Thanks,

Pramod

• ###### Re: Bell curve changes

For 1), can't you use class()?

I'm creating a histogram in a sense app with a bar chart using class() to create a dynamic dimension, and then a simple count to create the height of the bars:

Dimension: =class(aggr(sum([weight]*[performance])-1,value_date),0.005)

Measure: =Count(distinct value_date)

Which gives me this:

You should be able to use the class() function in the load script as well. You might need to fiddle around a bit with the number formats, but it should save you some hard-coding if nothing else.

Cheers,

Per Christian

• ###### Re: Bell curve changes

Hi Pramod

1) You can dinamically assign those values, ie:

If(total_time_taken<='00:01:00' ,Dual('00:00-01:00',0),

If(total_time_taken>'00:22:00',Dual('>22:00',22),

Dual(Num(Floor(total_time_taken*1440), '00') & ':00-' & Num(Floor(total_time_taken*1440+1), '00'), Floor(total_time_taken*1440))

2) I don't understant, aren't the values already showed?

3) you must add {1} to any funtion wich allows set analisys: Only(), Avg()...

From the qvf you posted expresions can be:

Count({1<subject_id={'2'},subject_status={'passed','completed'}>}time_interval)

Only({1} Normdist(Round(time_interval,1),Avg({1<subject_id={'2'},subject_status={'passed','completed'}>}total time_interval),Stdev({1<subject_id={'2'},subject_status={'passed','completed'}>}total time_interval), 0))*

1*Count({1<subject_id={'2'},subject_status={'passed','completed'}>}total time_interval)

• ###### Re: Bell curve changes

Hi Ruben Marin,

Thanks a lot for the reply.

1) it's working fine.

2) In bar chart we have value labels, in combo chart i am not able to find that. How can i add value labels?

3) It's working fine.

Thanks,

Pramod

• ###### Re: Bell curve changes

Ok, now I understand the 2), but I don't have a solution to that, hope another user gives us a hint.