Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

values differ from qlikview to database query result

We are trying get the Count(partner) based on the condition Joinedpartner>Weekenddate..

We are using the below condition:

Count(if(PartnerJoinDate>=Week_Start_Date__c and PartnerJoinDate<=Week_End_Date__c,Partner_Id__c)) but the values differ from the database query result.

Below are thevalues from database query:                                

Count
64
127
146
203
286
502
608
690
734
770
823
839
905

below are thevalue from qlikview:

Any ideas?

2 Replies
chauhans85
Esteemed Contributor

Re: values differ from qlikview to database query result

what result would you expect

what is your requirement?

use distinct if you are getting more than expected value

Count(distinct if(PartnerJoinDate>=Week_Start_Date__c and PartnerJoinDate<=Week_End_Date__c,Partner_Id__c))

hope this helps

Not applicable

Re: values differ from qlikview to database query result

ThankYou Sunil for the response.

I am sorry that I haven't explained the issue clearly.

I will Explain it again.

Basically there are 4 tables Week,partner,sales,quarter

sales and partner are related,

sales and quarter are related,

Quarter and Week are related,

Below table is the result from our database for the query

'select count(Id) from partner_c where createddate>=2012-03-31T00:00:00Z and  createddate<=2012-04-06T00:00:00Z" 

In the query the date  2012-03-31T00:00:00Z is weekstart date and  2012-04-06T00:00:00Z is Weekenddate.

We manually changed the date during the query, bcoz there is no direct relationship btw partner and Week tables

QuarterWeekEnd DateCount
2012-Q4Week 12012-04-06480
3/31/2012Week 22012-04-13951
6/29/2012Week 32012-04-201708
Week 42012-04-271708
Week 52012-05-042389
Week 62012-05-112715
Week 72012-05-183427
Week 82012-05-253953
Week 92012-06-014065
Week 102012-06-084407
Week 112012-06-155073
Week 122012-06-225073
Week 132012-06-295444

Coming to the Qlikview,

In the script level, I loaded Sales,partner,quarterand week tables.

I have taken Week as dimension and  the expression for partner is "Count (If(PartnerCreateddate>=Week_Start_Date__c and PartnerCreateddate<=Week_End_Date__c,Partner_Id__c))"

and I am getting the below results:

2012-Q4WEEK 0165
2012-Q4WEEK 02102
2012-Q4WEEK 0362
2012-Q4WEEK 05123
2012-Q4WEEK 0650
2012-Q4WEEK 07216
2012-Q4WEEK 0825
2012-Q4WEEK 1012
2012-Q4WEEK 11177

Is there any solution to the above  issue?

Awaiting for your reply.

Thanks,

Bharath Kumar

Community Browser