Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: its urgent Post Reply Post New Topic
<< Prev Page  of 5 Next >>
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Oct 2010 at 11:42am
you won't be able to do a top n or grouping in the main report from a sub report...
IP IP Logged
neha_patel
Groupie
Groupie
Avatar

Joined: 06 Oct 2010
Location: United States
Online Status: Offline
Posts: 44
Quote neha_patel Replybullet Posted: 07 Oct 2010 at 11:51am

its an independent report..... all other field i did..... but for this i have to use some logic that i knw..... like most visited 1 ==>5 point, most visited 2==>4 point, most visited 3==>3,most visited 4==>2, most visited 5==>1

thr are lots of site name..... every 5 site name will be thr some of them are common and some of them are diffrent. so when ever any site repeate thn have to add that much points to already exist point...... and at the end have to find 5 most high pointed site as most visited 5 sites and have to display..... but i am new to crystal report..... so dnt knw how to do that???
 
please help me if you can.....
thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Oct 2010 at 12:07pm

I think I see

Each column stores a name and you are assigning a value of 5 to 1.
You need to evaluate all of the sites that fall into each of the 5 columns and give the top 5 based on the sum of your assigned 5 to 1 value.
 
That is a nightmare in crystal.
how many data rows are you talking about?
If you cannot scrub your data outside of crystal (a view or stored procedure) you could do a crystal command object and uniono the table onto itself 5 times like so:
grab column 1 and call it 'name' make another column called 'score' as a value of 5
union it to
grab column 2 and call it 'name' make another column called 'score' as a value of 4
union it to
grab column 3 and call it 'name' make another column called 'score' as a value of 3
etc.
then you can easily do a grouping on the name and summing on the score and get your top 5 from that.
IP IP Logged
neha_patel
Groupie
Groupie
Avatar

Joined: 06 Oct 2010
Location: United States
Online Status: Offline
Posts: 44
Quote neha_patel Replybullet Posted: 08 Oct 2010 at 2:25am
no no.... i m telling you..... i have 5 field in my table name
"Most visited 1"
"Most visited 2"
"Most visited 3"
"Most visited 4"
"Most visited 5"
 
and this field stores.... most visited 5 sites where "Most visited 1" is highest... and so on......
 
when i will group by site name...... thn i am doing all other fields total.... but for this 5 field i have to find...... most visited 5 site....... and have to display that in reports..........
 
and i am telling you what i am thinking to do for this......
 
i am thinking if thr is any way to do all this field combine and rank them 1 to 5 for all that 5 field.... like
"Most visited 1" 5 points..
"Most visited 2" 4 points and so on...... and i will find that same site again thn i will add that points to my current point total..... and if tht site name is not in list thn i will add tht field with its point in list..... so i can check for that site name next time......
 
this is only what i think.... i dnt knw this i can do in crystal report or not..... and i dnt knw what is other way to do this thing in crystal report..... please help me........
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2010 at 4:49am
Originally posted by neha_patel

"Most visited 1"
"Most visited 2"
"Most visited 3"
"Most visited 4"
"Most visited 5"
 
 
 
These are all on one data row correct?
This makes getting the top # a nightmare at best.
I am suggesting you alter it so that each of these are on one row.
Then you can group on that row and get your sums easily.


Edited by DBlank - 11 Oct 2010 at 4:49am
IP IP Logged
neha_patel
Groupie
Groupie
Avatar

Joined: 06 Oct 2010
Location: United States
Online Status: Offline
Posts: 44
Quote neha_patel Replybullet Posted: 11 Oct 2010 at 4:55am
but i can not alter that bcoz my comp. provides me this database and they are using this as main data base....
IP IP Logged
neha_patel
Groupie
Groupie
Avatar

Joined: 06 Oct 2010
Location: United States
Online Status: Offline
Posts: 44
Quote neha_patel Replybullet Posted: 11 Oct 2010 at 4:57am
hey that day you gave me that running total formula's answer..... i created that running total.... and i am using that running total in my formula.... and i genrated one field..... now i want to do total of that formula field.... at the end of each group...... can you tell me how to do that..... thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2010 at 5:01am
Sicne you cannot alter the DB use a crystal COMMAND to do the UNION approach as i suggested earlier.  
 
select mostvisited1field as NAME, 5 as AMOUNT
from tablename
UNION
select mostvisited2field as NAME, 4 as AMOUNT
from tablename
UNION
select mostvisited3field as NAME, 3 as AMOUNT
from tablename
UNION
select mostvisited4field as NAME, 2 as AMOUNT
from tablename
UNION
select mostvisited5field as NAME, 1 as AMOUNT
from tablename
IP IP Logged
neha_patel
Groupie
Groupie
Avatar

Joined: 06 Oct 2010
Location: United States
Online Status: Offline
Posts: 44
Quote neha_patel Replybullet Posted: 12 Oct 2010 at 6:43am
thanks for your help i will try this......
IP IP Logged
neha_patel
Groupie
Groupie
Avatar

Joined: 06 Oct 2010
Location: United States
Online Status: Offline
Posts: 44
Quote neha_patel Replybullet Posted: 12 Oct 2010 at 7:08am
hey i have to write this in Sql Command..... sorry for this type of questions but i am new to crystal report...... please explain me in brief.....how to work with my this problem.....
 
thank you....
IP IP Logged
<< Prev Page  of 5 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.