Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Descending order [SOLVED]
Go
New
Search
Notify
Tools
Reply
  
Descending order [SOLVED]
 Login/Join
 
Gold member
posted
Hi All,
i want my Counter should be in descending order and also i want only first 5 records
 
-DEFAULT &END_DATE = 100110
-SET &END_DATE = EDIT(&END_DATE, '99/') | EDIT(&END_DATE, '$$99$$/') | EDIT(&END_DATE, '$$$$99') ;
DEFINE FILE CAR
COUNTER/I5 = 1;
END
TABLE FILE CAR
SUM
CAR
MODEL
COUNTER
BY CAR NOPRINT
WHERE DEALER_COST GE 4915
END
 


Thanks,
Krish.

This message has been edited. Last edited by: Krishna.edara,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 89 | Registered: September 20, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
  DEFAULT &END_DATE = 100110
- INCLUDE MXTRACKLOG.FEX
-SET &END_DATE = EDIT(&END_DATE, '99/') | EDIT(&END_DATE, '$$99$$/') | EDIT(&END_DATE, '$$$$99') ;
DEFINE FILE CAR
COUNTER/P8 WITH CAR =LAST COUNTER+1;

END
TABLE FILE CAR
SUM
CAR
MODEL
 
BY LOWEST 5 COUNTER  
BY CAR NOPRINT
WHERE DEALER_COST GE 4915
END
 


 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Prarie,
Thanks for reply...
it is working fine but it is not reaching my requirement,
the model should count if it repeats(iam counting the repeted Models only )
iam getting with following code but iam unable to get the highest 5 in Decending order.
In this Example the Model is not repeting, but in my case it will repeate so i want to count them and should show in Decending order of first 5

 
DEFINE FILE CAR
COUNTER/P8 =1;
END
TABLE FILE CAR
SUM
CAR
MODEL
COUNTER
BY HIGHEST 5 COUNTER  NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
WHERE DEALER_COST GE 4915
END 


Thanks,
Krish.

This message has been edited. Last edited by: Krishna.edara,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 89 | Registered: September 20, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
krish,

I'm unclear of what the purpose of your counter is? If you just want the first 5 records in a table then I would use WHERE RECORDLIMIT EQ 5 to get the first 5 records. But then you have no control over the actual order that they are in. What do you mean the Model should count if it repeats? In this example if you want to know the 5 Countries that have more then 1 car I would write my code as such:
(I changed it to 3 Countries that have more then 1 car because there weren't enough qualifying countries that satisfied the point.)

  
DEFINE FILE CAR
COUNTER/I8=1;
END
TABLE FILE CAR
SUM COUNTER
	CAR NOPRINT
	MODEL NOPRINT
BY HIGHEST TOTAL COUNTER
BY COUNTRY
WHERE TOTAL COUNTER GT 1
ON TABLE HOLD AS CARS
END
TABLE FILE CARS
PRINT COUNTER
BY HIGHEST  COUNTER
BY COUNTRY
WHERE RECORDLIMIT EQ 3
END


Am I close to understanding what you are trying to acheive?


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
 
Posts: 95 | Registered: July 31, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Something like this?

IF MODEL EQ LAST MODEL THEN COUNTER+1 ELSE 0;

You will have to set the counter to 0 to start.

Do some searches here on the Forum of different ways to do counters.

Search on COUNTER
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi EWoerle,
My actual intention is to count the Hits on Tag and show the top 5 Hits on Tag,
Here is my actual code iam using

 
-DEFAULT &END_DATE = 101010
-SET &END_DATE = EDIT(&END_DATE, '99/') | EDIT(&END_DATE, '$$99$$/') | EDIT(&END_DATE, '$$$$99') ;
DEFINE FILE LOG
HIT/P8 = 1;
HITS/P8 WITH TAG =HIT;
END
TABLE FILE LOG
SUM
PROGRAM 
TAG 
HITS 
BY HIGHEST 5 HITS NOPRINT
BY PROGRAM NOPRINT
BY TAG  NOPRINT
WHERE LOGDATE GE '&END_DATE'
END


Thanks,
Krish.


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 89 | Registered: September 20, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
Krish,

Have you tried either of the suggestions that Prarie or I have given you? It seems that either one or a combination of the both should have your answer in it. Is there a piece of either one of our codes that you would like us to explain better that maybe you didn't understand?

From what I am reading you want to know who your top 5 users are that are running reports. If that is correct then you have everything you need to acheive that and me writing the report for you will not help you learn.


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
 
Posts: 95 | Registered: July 31, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks EWoerle and Prarie,
It did worked for me.

Thanks,
Krish.


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 89 | Registered: September 20, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
Krish, have you considered going on training, it will assist you in some of these basic questions.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Descending order [SOLVED]

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.