Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

using calculated dimension

hi ,

I would like to build a graph to show a count if customer who has called in a certain amount of days from starting with the company . the formula I am using is avg(distinct(if(CallStartDt<BillDate,BillDate-CallStartDt))) . Now I want to use this a calculated dimension for a bar graph.

maybe I am missing something.

regards,

marvin

3 Replies
sunny_talwar

May be like this

Dimension

Aggr(If(CallStartDt < BillDate, BillDate-CallStartDt), Customer)

Expression

Count(DISTINCT Customer)

rupamjyotidas
Specialist
Specialist

Make a flag in Script

If(CallStartDt < BillDate,1,0) as Flag


Then

Dimension

Aggr(if(Flag=1, BillDate-CallStartDt),Customer)


Even Better if possible(depending on your datamodel)

If(CallStartDt < BillDate,BillDate-CallStartDt,'NA') as DateDiff

Then Dimension

Aggr(if(DateDiff<>'NA',avg(DateDiff)),Customer)

Anonymous
Not applicable
Author

Hi Marvin,

You can use following.

Dimension:- aggr(avg((if(CallStartDt<BillDate,BillDate-CallStartDt))),Customer)

Expression:- Count(DISTINCT Customer)

Thanks,