RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread WebDude
Well... That's the way I do it. But it seems that you cannot have a blank
variable or multiple sorts within 1 variable... Or am I missing something
here.

Do you have an example? 



-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Monday, March 01, 2010 10:13 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


I found it better and faster to do the sort after the results are returned
in the Results Action.  Use a user variable and keep appending  to the
beginning, then use the variable in the sort tag.  Remember to have a way to
clear the sort and the variable

Ted


-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Mon 3/1/2010 7:29 PM
To: witango-talk@witango.com
Subject: Witango-Talk: Multiple Sorts
 
Typically in the past, I load a sort into a variable and then add that
variable as a sort in the search function...
 
I then use an argument to change the sorts...
 
@IFEQUAL @ARG sort 1@ASSIGN sort company_info.company/@IF
@IFEQUAL @ARG sort 2@ASSIGN sort company_info.lname/@IF @IFEQUAL
@ARG sort 3@ASSIGN sort company_info.state/@IF @IFEQUAL @ARG
sort 4@ASSIGN sort company_info.customer_id/@IF
 
I've been going around and around on this... is there anyway to hold onto
the sorts so, let's say, they click on Company first, and then click on last
name, they get a sort by lname, company. An thus, if they click next on
State, they get a sort of state, lname, company... and so on. 
 
I'm sure this has comeup before... I just can't find the answer.
 
Thanks!
 
 


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf



RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
Here is a quick example, all in a Results Action:

order of columns returned: company, lname, state, customerid

build the sort:
@ASSIGN NAME=vsortorder VALUE= SCOPE=user
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF


Sort the results set, checking if there is results first or it will
error:
@IFEMPTY VALUE=@@request$ResultSet
@else
@IFEMPTY VALUE=@@request$vsortorder
@else
@SORT ARRAY=ResultSet scope=request
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

I did the example in ascending order, it can also be done in descending
or both directions, just add additional @elseif to the sortorder
statements.

Ted
-Original Message-
From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 7:31 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Well... That's the way I do it. But it seems that you cannot have a
blank
variable or multiple sorts within 1 variable... Or am I missing
something
here.

Do you have an example? 



-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Monday, March 01, 2010 10:13 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


I found it better and faster to do the sort after the results are
returned
in the Results Action.  Use a user variable and keep appending  to the
beginning, then use the variable in the sort tag.  Remember to have a
way to
clear the sort and the variable

Ted


-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Mon 3/1/2010 7:29 PM
To: witango-talk@witango.com
Subject: Witango-Talk: Multiple Sorts
 
Typically in the past, I load a sort into a variable and then add that
variable as a sort in the search function...
 
I then use an argument to change the sorts...
 
@IFEQUAL @ARG sort 1@ASSIGN sort company_info.company/@IF
@IFEQUAL @ARG sort 2@ASSIGN sort company_info.lname/@IF
@IFEQUAL
@ARG sort 3@ASSIGN sort company_info.state/@IF @IFEQUAL @ARG
sort 4@ASSIGN sort company_info.customer_id/@IF
 
I've been going around and around on this... is there anyway to hold
onto
the sorts so, let's say, they click on Company first, and then click on
last
name, they get a sort by lname, company. An thus, if they click next on
State, they get a sort of state, lname, company... and so on. 
 
I'm sure this has comeup before... I just can't find the answer.
 
Thanks!
 
 


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf



RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
One correction, delete the @ASSIGN NAME=vsortorder VALUE=
SCOPE=user line before the first if statement or the sortorder will
only sort on one column.

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Tuesday, March 02, 2010 8:32 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Here is a quick example, all in a Results Action:

order of columns returned: company, lname, state, customerid

build the sort:
ASSIGN NAME=vsortorder VALUE= SCOPE=user
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF


Sort the results set, checking if there is results first or it will
error:
@IFEMPTY VALUE=@@request$ResultSet
@else
@IFEMPTY VALUE=@@request$vsortorder
@else
@SORT ARRAY=ResultSet scope=request
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

I did the example in ascending order, it can also be done in descending
or both directions, just add additional @elseif to the sortorder
statements.

Ted
-Original Message-
From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 7:31 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Well... That's the way I do it. But it seems that you cannot have a
blank
variable or multiple sorts within 1 variable... Or am I missing
something
here.

Do you have an example? 



-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Monday, March 01, 2010 10:13 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


I found it better and faster to do the sort after the results are
returned
in the Results Action.  Use a user variable and keep appending  to the
beginning, then use the variable in the sort tag.  Remember to have a
way to
clear the sort and the variable

Ted


-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Mon 3/1/2010 7:29 PM
To: witango-talk@witango.com
Subject: Witango-Talk: Multiple Sorts
 
Typically in the past, I load a sort into a variable and then add that
variable as a sort in the search function...
 
I then use an argument to change the sorts...
 
@IFEQUAL @ARG sort 1@ASSIGN sort company_info.company/@IF
@IFEQUAL @ARG sort 2@ASSIGN sort company_info.lname/@IF
@IFEQUAL
@ARG sort 3@ASSIGN sort company_info.state/@IF @IFEQUAL @ARG
sort 4@ASSIGN sort company_info.customer_id/@IF
 
I've been going around and around on this... is there anyway to hold
onto
the sorts so, let's say, they click on Company first, and then click on
last
name, they get a sort by lname, company. An thus, if they click next on
State, they get a sort of state, lname, company... and so on. 
 
I'm sure this has comeup before... I just can't find the answer.
 
Thanks!
 
 


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf



RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
My mistake on the @@request$vsortorder should have been
@@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex(
sort version): if existing sort order is 1,2,3,4 and the new sort to
be added is 3 to make the sort 3,1,2,4 you have to remove the
existing 3 first. 

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 
Okay, I got the vsortorder to load... Pretty slick. First off, I cannot
use
@@request$vsortorder... It just isn't being recognized. I think I have
an
older version of Witango that doesn't let me use that scope. When I
change
it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all
work
exactly as planned) and then Witango crashes. I am muxing the result
array
somehow. I am not sure how to post the sort arguments... Do I need to do
a
search for every post of the sort? Here is what I have so far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN
HTML
HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@VAR vsortorder@COMMENTJust so I can watch it/@COMMENT

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

P
/P
TABLE BORDER=0
TR VALIGN=TOP ALIGN=LEFT
TD
Ba
href=@APPFILE?_function=listsort=1Company/a/B
/TD
TD
Ba
href=@APPFILE?_function=listsort=2Lname/a/B
/TD
TD
Ba
href=@APPFILE?_function=listsort=3State/a/B
/TD
TD
Ba href=@APPFILE?_function=listsort=4ID/a/B
/TD
/TR
@ROWS
TR VALIGN=TOP
TD
A
HREF=@APPFILE?_function=detaillogin_request_uid1=@COLUMN
login_request.ID ENCODING=URL@UserReferenceArgument@COLUMN
login_request.Company/A
/TD
TD
@COLUMN login_request.Lname
/TD
TD
@COLUMN login_request.State
/TD
TD
@COLUMN login_request.ID
/TD
/TR
/@ROWS
/TABLE

P
/BODY
/HTML

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Tuesday, March 02, 2010 7:35 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

One correction, delete the @ASSIGN NAME=vsortorder VALUE=
SCOPE=user line before the first if statement or the sortorder will
only
sort on one column.

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 8:32 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Here is a quick example, all in a Results Action:

order of columns returned: company, lname, state, customerid

build the sort:
ASSIGN NAME=vsortorder VALUE= SCOPE=user @IF EXPR=@ARG sort=
1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@@request$vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Robert Shubert
This would probably be slightly easier if you maintained the sort column and
direction in a 2-column array (user scope) and then adjusted the array
(using @FILTER and @ADDROWS) as the user requests. Then you would only need
a small routine (TCF call?) to convert the array into the ORDER BY clause.

The array would allow you to remove all of the IF statements, easily
establish a initial sort order, and would be very easy to manipulate if you
made the argument of the sort order link the same syntax as the value of the
@ADDROWS (although this does give away hints as to the internal structure of
your database.)

Robert

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Tuesday, March 02, 2010 10:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been
@@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex(
sort version): if existing sort order is 1,2,3,4 and the new sort to
be added is 3 to make the sort 3,1,2,4 you have to remove the
existing 3 first. 

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 
Okay, I got the vsortorder to load... Pretty slick. First off, I cannot
use
@@request$vsortorder... It just isn't being recognized. I think I have
an
older version of Witango that doesn't let me use that scope. When I
change
it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all
work
exactly as planned) and then Witango crashes. I am muxing the result
array
somehow. I am not sure how to post the sort arguments... Do I need to do
a
search for every post of the sort? Here is what I have so far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN
HTML
HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@VAR vsortorder@COMMENTJust so I can watch it/@COMMENT

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

P
/P
TABLE BORDER=0
TR VALIGN=TOP ALIGN=LEFT
TD
Ba
href=@APPFILE?_function=listsort=1Company/a/B
/TD
TD
Ba
href=@APPFILE?_function=listsort=2Lname/a/B
/TD
TD
Ba
href=@APPFILE?_function=listsort=3State/a/B
/TD
TD
Ba href=@APPFILE?_function=listsort=4ID/a/B
/TD
/TR
@ROWS
TR VALIGN=TOP
TD
A
HREF=@APPFILE?_function=detaillogin_request_uid1=@COLUMN
login_request.ID ENCODING=URL@UserReferenceArgument@COLUMN
login_request.Company/A
/TD
TD
@COLUMN login_request.Lname
/TD
TD
@COLUMN login_request.State
/TD
TD
@COLUMN login_request.ID
/TD
/TR
/@ROWS
/TABLE

P
/BODY
/HTML

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Tuesday, March 02, 2010 7:35 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

One correction, delete the @ASSIGN NAME=vsortorder VALUE=
SCOPE=user line before the first if statement or the sortorder will
only
sort on one column.

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 8:32 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Here is a quick example, all in a Results Action:

order of columns returned: company, lname, state, customerid

build

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread WebDude
Now for the $10,000 question... If you are using a max of 100 returns and
paging through the returns, is there a way of carrying the sort(s) through
to the next page. 
 
John Muldoon
Corporate Incentives
3416 Nicollet Ave S
Minneapolis, MN 55408-4552
612.822.
webd...@cipromo.com

 http://cipromo.com/ http://cipromo.com
 
 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts



Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local COLS=@VAR
vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been @@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex( sort
version): if existing sort order is 1,2,3,4 and the new sort to be added
is 3 to make the sort 3,1,2,4 you have to remove the existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot use
@@request$vsortorder... It just isn't being recognized. I think I have an
older version of Witango that doesn't let me use that scope. When I change
it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all work
exactly as planned) and then Witango crashes. I am muxing the result array
somehow. I am not sure how to post the sort arguments... Do I need to do a
search for every post of the sort? Here is what I have so far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
Put the ResultSet  from the initial search in an user variable and only
replace it when a new search is preformed.  

 

Sort the user$ResultSet then display pages using the start and stop
attributes of the  @ROWS START=@@request$vstart STEP=1
STOP=@@request$vstop ARRAY= /@ROWS tag.

 

Ted 

 

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns
and paging through the returns, is there a way of carrying the sort(s)
through to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com

 

http://cipromo.com http://cipromo.com/ 

 

 

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been
@@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex(
sort version): if existing sort order is 1,2,3,4 and the new sort to
be added is 3 to make the sort 3,1,2,4 you have to remove the
existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot
use @@request$vsortorder... It just isn't being recognized. I think I
have an older version of Witango that doesn't let me use that scope.
When I change it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all
work exactly as planned) and then Witango crashes. I am muxing the
result array somehow. I am not sure how to post the sort arguments... Do
I need to do a search for every post of the sort? Here is what I have so
far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Robert Shubert
If you are using SQL server to limit the results, then you can not use the
@SORT option, but must use the ORDER BY SQL clause. Ted's option of using
@SORT and @ROWS start=/stop= only works if you initially retrieve the
entire dataset from SQL and store it as a user variable as he explained.
This will usually work, but can be deadly if you are working with many
thousands of rows or more. Robert

 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns and
paging through the returns, is there a way of carrying the sort(s) through
to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com



 http://cipromo.com/ http://cipromo.com

 

 

 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local COLS=@VAR
vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been @@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex( sort
version): if existing sort order is 1,2,3,4 and the new sort to be added
is 3 to make the sort 3,1,2,4 you have to remove the existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot use
@@request$vsortorder... It just isn't being recognized. I think I have an
older version of Witango that doesn't let me use that scope. When I change
it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all work
exactly as planned) and then Witango crashes. I am muxing the result array
somehow. I am not sure how to post the sort arguments... Do I need to do a
search for every post of the sort? Here is what I have so far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread WebDude
bummer... 
 
 Yes... we are using an SQL server... any suggestions?
 
 

  _  

From: Robert Shubert [mailto:rshub...@tronics.com] 
Sent: Tuesday, March 02, 2010 12:04 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts



If you are using SQL server to limit the results, then you can not use the
@SORT option, but must use the ORDER BY SQL clause. Ted's option of using
@SORT and @ROWS start=/stop= only works if you initially retrieve the
entire dataset from SQL and store it as a user variable as he explained.
This will usually work, but can be deadly if you are working with many
thousands of rows or more. Robert

 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns and
paging through the returns, is there a way of carrying the sort(s) through
to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com



 http://cipromo.com/ http://cipromo.com

 

 

 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local COLS=@VAR
vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been @@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex( sort
version): if existing sort order is 1,2,3,4 and the new sort to be added
is 3 to make the sort 3,1,2,4 you have to remove the existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot use
@@request$vsortorder... It just isn't being recognized. I think I have an
older version of Witango that doesn't let me use that scope. When I change
it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all work
exactly as planned) and then Witango crashes. I am muxing the result array
somehow. I am not sure how to post the sort arguments... Do I need to do a
search for every post of the sort? Here is what I have so far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
If you are using SQL SERVER you can actually use both.  Set the number
of results to be returned using the SET ROWCOUNT  n option;  Then use
the ORDER BY SQL  to retrieve the latest n records. Remember to use SET
ROWCOUNT  0 to turn off the option.  

 

In DirectDBMS:

SET ROWCOUNT  100;

Select * from table order by date desc;

SET ROWCOUNT  0;

 

You now have the Resultset available for sorting.

 

Ted

 

From: Robert Shubert [mailto:rshub...@tronics.com] 
Sent: Tuesday, March 02, 2010 1:04 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

If you are using SQL server to limit the results, then you can not use
the @SORT option, but must use the ORDER BY SQL clause. Ted's option of
using @SORT and @ROWS start=/stop= only works if you initially
retrieve the entire dataset from SQL and store it as a user variable as
he explained. This will usually work, but can be deadly if you are
working with many thousands of rows or more. Robert

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns
and paging through the returns, is there a way of carrying the sort(s)
through to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com

 

http://cipromo.com http://cipromo.com/ 

 

 

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been
@@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex(
sort version): if existing sort order is 1,2,3,4 and the new sort to
be added is 3 to make the sort 3,1,2,4 you have to remove the
existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot
use @@request$vsortorder... It just isn't being recognized. I think I
have an older version of Witango that doesn't let me use that scope.
When I change it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all
work exactly as planned) and then Witango crashes. I am muxing the
result array somehow. I am not sure how to post the sort arguments... Do
I need to do a search for every post of the sort? Here is what I have so
far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD
TITLEMatching Records/TITLE
/HEAD

BODY

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread WebDude
SET ROWCOUNT  n? Where is this?
date desc;?  no date here
 
 
John Muldoon
Corporate Incentives
3416 Nicollet Ave S
Minneapolis, MN 55408-4552
612.822.
webd...@cipromo.com

 http://cipromo.com/ http://cipromo.com
 
 

  _  

From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Tuesday, March 02, 2010 12:45 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts



If you are using SQL SERVER you can actually use both.  Set the number of
results to be returned using the SET ROWCOUNT  n option;  Then use the ORDER
BY SQL  to retrieve the latest n records. Remember to use SET ROWCOUNT  0 to
turn off the option.  

 

In DirectDBMS:

SET ROWCOUNT  100;

Select * from table order by date desc;

SET ROWCOUNT  0;

 

You now have the Resultset available for sorting.

 

Ted

 

From: Robert Shubert [mailto:rshub...@tronics.com] 
Sent: Tuesday, March 02, 2010 1:04 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

If you are using SQL server to limit the results, then you can not use the
@SORT option, but must use the ORDER BY SQL clause. Ted's option of using
@SORT and @ROWS start=/stop= only works if you initially retrieve the
entire dataset from SQL and store it as a user variable as he explained.
This will usually work, but can be deadly if you are working with many
thousands of rows or more. Robert

 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns and
paging through the returns, is there a way of carrying the sort(s) through
to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com



 http://cipromo.com/ http://cipromo.com

 

 

 

  _  

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local COLS=@VAR
vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been @@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex( sort
version): if existing sort order is 1,2,3,4 and the new sort to be added
is 3 to make the sort 3,1,2,4 you have to remove the existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot use
@@request$vsortorder... It just isn't being recognized. I think I have an
older version of Witango that doesn't let me use that scope. When I change
it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all work
exactly as planned

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
Set Rowcount is an sql server option  that limits the number of rows
returned.  I used date as an example.

 

Ted

 

From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 1:57 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

SET ROWCOUNT  n? Where is this?

date desc;?  no date here

 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com

 

http://cipromo.com http://cipromo.com/ 

 

 

 



From: Ted Wolfley [mailto:t...@ogdengroup.com] 
Sent: Tuesday, March 02, 2010 12:45 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

If you are using SQL SERVER you can actually use both.  Set the number
of results to be returned using the SET ROWCOUNT  n option;  Then use
the ORDER BY SQL  to retrieve the latest n records. Remember to use SET
ROWCOUNT  0 to turn off the option.  

 

In DirectDBMS:

SET ROWCOUNT  100;

Select * from table order by date desc;

SET ROWCOUNT  0;

 

You now have the Resultset available for sorting.

 

Ted

 

From: Robert Shubert [mailto:rshub...@tronics.com] 
Sent: Tuesday, March 02, 2010 1:04 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

If you are using SQL server to limit the results, then you can not use
the @SORT option, but must use the ORDER BY SQL clause. Ted's option of
using @SORT and @ROWS start=/stop= only works if you initially
retrieve the entire dataset from SQL and store it as a user variable as
he explained. This will usually work, but can be deadly if you are
working with many thousands of rows or more. Robert

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns
and paging through the returns, is there a way of carrying the sort(s)
through to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com



http://cipromo.com http://cipromo.com/ 

 

 

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been
@@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex(
sort version): if existing sort order is 1,2,3,4 and the new sort to
be added is 3 to make the sort 3,1,2,4 you have to remove the
existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got

RE: Witango-Talk: Multiple Sorts

2010-03-02 Thread Ted Wolfley
Now that I think about it, the WHERE limits the results, ORDER BY just
sorts.  In Witango, I found it is faster to retrieve the limited
unsorted Resultset  and do the sorting in Witango. 

 

Ted

 

From: Robert Shubert [mailto:rshub...@tronics.com] 
Sent: Tuesday, March 02, 2010 1:04 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

If you are using SQL server to limit the results, then you can not use
the @SORT option, but must use the ORDER BY SQL clause. Ted's option of
using @SORT and @ROWS start=/stop= only works if you initially
retrieve the entire dataset from SQL and store it as a user variable as
he explained. This will usually work, but can be deadly if you are
working with many thousands of rows or more. Robert

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 12:42 PM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

 

Now for the $10,000 question... If you are using a max of 100 returns
and paging through the returns, is there a way of carrying the sort(s)
through to the next page. 

 

John Muldoon

Corporate Incentives

3416 Nicollet Ave S

Minneapolis, MN 55408-4552

612.822.

webd...@cipromo.com

 

http://cipromo.com http://cipromo.com/ 

 

 

 



From: WebDude [mailto:webd...@cipromo.com] 
Sent: Tuesday, March 02, 2010 11:13 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

Not very pretty, but this works great! Thanks!

@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 1 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 2
@COMMENTlname/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=2 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 2 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 3
@COMMENTstate/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=3 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 3 NUM ASC REPLACESTR='
/@IF
@ELSEIF EXPR=@ARG sort= 4
@COMMENTcustomerid/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder VALUE=4 NUM ASC, @VAR
vsortorder SCOPE=User  SCOPE=user
@ASSIGN vsortorder '@REPLACE STR=@VAR vsortorder
FINDSTR=, 4 NUM ASC REPLACESTR='
/@IF
@ELSE
@COMMENTdefault/@COMMENT
@ASSIGN NAME=vsortorder VALUE= SCOPE=user

/@IF

@IFEMPTY VALUE=@VAR ResultSet
@else
@IFEMPTY VALUE=@VAR vsortorder
@else
@SORT ARRAY=ResultSet scope=local
COLS=@VAR vsortorder SCOPE=User
/@IF
/@IF

-Original Message-
From: Ted Wolfley [mailto:t...@ogdengroup.com]
Sent: Tuesday, March 02, 2010 9:48 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts

My mistake on the @@request$vsortorder should have been
@@user$vsortorder.

You will have to add a replace tag before assigning the new sort. Ex(
sort version): if existing sort order is 1,2,3,4 and the new sort to
be added is 3 to make the sort 3,1,2,4 you have to remove the
existing 3 first.

Ted

-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Tuesday, March 02, 2010 10:25 AM
To: witango-talk@witango.com
Subject: RE: Witango-Talk: Multiple Sorts


Okay, I got the vsortorder to load... Pretty slick. First off, I cannot
use @@request$vsortorder... It just isn't being recognized. I think I
have an older version of Witango that doesn't let me use that scope.
When I change it to @VAR vsortorder it works fine.

Now that being said... I get to around 5 clicks (in which the sorts all
work exactly as planned) and then Witango crashes. I am muxing the
result array somehow. I am not sure how to post the sort arguments... Do
I need to do a search for every post of the sort? Here is what I have so
far.

By the way... Thank you for the help... I appreciate it.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD
TITLEMatching Records/TITLE
/HEAD

BODY
@IF EXPR=@ARG sort= 1
@COMMENTcompany/@COMMENT
@IFEMPTY VALUE=@VAR vsortorder
@ASSIGN NAME=vsortorder VALUE=1 NUM ASC
SCOPE=user
@else
@ASSIGN NAME=vsortorder

RE: Witango-Talk: Multiple Sorts

2010-03-01 Thread Ted Wolfley

I found it better and faster to do the sort after the results are returned in 
the Results Action.  Use a user variable and keep appending  to the beginning, 
then use the variable in the sort tag.  Remember to have a way to clear the 
sort and the variable

Ted


-Original Message-
From: WebDude [mailto:webd...@cipromo.com]
Sent: Mon 3/1/2010 7:29 PM
To: witango-talk@witango.com
Subject: Witango-Talk: Multiple Sorts
 
Typically in the past, I load a sort into a variable and then add that
variable as a sort in the search function...
 
I then use an argument to change the sorts...
 
@IFEQUAL @ARG sort 1@ASSIGN sort company_info.company/@IF
@IFEQUAL @ARG sort 2@ASSIGN sort company_info.lname/@IF
@IFEQUAL @ARG sort 3@ASSIGN sort company_info.state/@IF
@IFEQUAL @ARG sort 4@ASSIGN sort company_info.customer_id/@IF
 
I've been going around and around on this... is there anyway to hold onto
the sorts so, let's say, they click on Company first, and then click on last
name, they get a sort by lname, company. An thus, if they click next on
State, they get a sort of state, lname, company... and so on. 
 
I'm sure this has comeup before... I just can't find the answer.
 
Thanks!
 
 


TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf



TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.tafwinmail.dat