iMtG Server: Gathering

Gathering Forums => Help for iMtG => Topic started by: darkshanx on March 26, 2013, 04:07:20 PM

Title: Searching in binders
Post by: darkshanx on March 26, 2013, 04:07:20 PM
Is there a way to search for cards like you can in card database but with only cards in a binder?

Also what's the predicate in card database where it currently had TRUEPREDICATE
What's it do?
Title: Re: Searching in binders
Post by: reezel on March 26, 2013, 04:48:01 PM
I want so bad in the filters to be able to include/exclude specific binders and decks.
Title: Re: Searching in binders
Post by: darkshanx on March 26, 2013, 05:02:23 PM
Yeah. In trying to use the predicate which I think is SQL or whatever which I've no clue about.
Put in this in to try to do it

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection ).@count = 0

Complete collection is my binder name so I can search just that. I check it it says looks ok but then click back and the app crashes
Title: Re: Searching in binders
Post by: Piotr on March 26, 2013, 05:40:21 PM
Quote from: darkshanx on March 26, 2013, 05:02:23 PM
Yeah. In trying to use the predicate which I think is SQL or whatever which I've no clue about.
Put in this in to try to do it

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection ).@count = 0

Complete collection is my binder name so I can search just that. I check it it says looks ok but then click back and the app crashes

Well it should, you created properly broken predicate and the check is very dumb. Try this:

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count = 0

and this

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count > 0

You can save these as Bookmarks and that's it, iMtG can do what you wanted already.
Title: Re: Searching in binders
Post by: darkshanx on March 26, 2013, 05:52:56 PM
Quote from: Piotr on March 26, 2013, 05:40:21 PM
Quote from: darkshanx on March 26, 2013, 05:02:23 PM
Yeah. In trying to use the predicate which I think is SQL or whatever which I've no clue about.
Put in this in to try to do it

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection ).@count = 0

Complete collection is my binder name so I can search just that. I check it it says looks ok but then click back and the app crashes

Well it should, you created properly broken predicate and the check is very dumb. Try this:

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count = 0

and this

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count > 0

You can save these as Bookmarks and that's it, iMtG can do what you wanted already.

Thanks the second one worked. I worked it out before I checked here again but the > sign made it work. I took another predicate and was editing it. I've no idea about this stuff but took a guess an it works. What else can it do? The predicate?
Title: Re: Searching in binders
Post by: Piotr on March 26, 2013, 05:55:54 PM
Quote from: darkshanx on March 26, 2013, 05:52:56 PM
Quote from: Piotr on March 26, 2013, 05:40:21 PM
Quote from: darkshanx on March 26, 2013, 05:02:23 PM
Yeah. In trying to use the predicate which I think is SQL or whatever which I've no clue about.
Put in this in to try to do it

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection ).@count = 0

Complete collection is my binder name so I can search just that. I check it it says looks ok but then click back and the app crashes

Well it should, you created properly broken predicate and the check is very dumb. Try this:

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count = 0

and this

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count > 0

You can save these as Bookmarks and that's it, iMtG can do what you wanted already.

Thanks the second one worked. I worked it out before I checked here again but the > sign made it work. I took another predicate and was editing it. I've no idea about this stuff but took a guess an it works. What else can it do? The predicate?

O my world, it can do magic indeed. I think I had a post on predicates on the old wiki that I forgot to move. Or maybe I didn't.
Title: Re: Searching in binders
Post by: darkshanx on March 26, 2013, 05:59:50 PM
Oh right. It would be cool if I could find that. I like the predicate thing only guessed how to do some because I've been doing computing GCSE but using a dead programming language which is a bit stupid. Thanks for the help. Guess I can do the same with decks by replacing binder with deck
Title: Re: Searching in binders
Post by: reezel on March 27, 2013, 12:29:59 AM
That predicate example was very helpful. The issue I see now is I am not getting total cards. I would like to, for example , see how many white cards I have in my binder 'Cube'. Is there a way to do that?
Title: Re: Searching in binders
Post by: darkshanx on March 27, 2013, 02:51:12 AM
Quote from: reezel on March 27, 2013, 12:29:59 AM
That predicate example was very helpful. The issue I see now is I am not getting total cards. I would like to, for example , see how many white cards I have in my binder 'Cube'. Is there a way to do that?

Closest I can get is each type of card not every copy. Using the predicate to search only that binder go into filter again and select only white create a new bookmark of what you have filter and use that bookmark. It will count all the white cards (including hybrid and double if you've not selected exclude unselected colour) but not all copies of them
Title: Re: Searching in binders
Post by: reezel on March 27, 2013, 08:53:54 AM
Quote from: darkshanx on March 27, 2013, 02:51:12 AM
Quote from: reezel on March 27, 2013, 12:29:59 AM
That predicate example was very helpful. The issue I see now is I am not getting total cards. I would like to, for example , see how many white cards I have in my binder 'Cube'. Is there a way to do that?

Closest I can get is each type of card not every copy. Using the predicate to search only that binder go into filter again and select only white create a new bookmark of what you have filter and use that bookmark. It will count all the white cards (including hybrid and double if you've not selected exclude unselected colour) but not all copies of them
Thank you. I was able to make a bookmark for just the white spells in my cube, which is exactly what I was looking for. The next filter I am looking for is just the gold/hybrid cards in a Binder. Anyone have any idea if this is possible at the moment.
Title: Re: Searching in binders
Post by: darkshanx on March 27, 2013, 12:00:48 PM
Quote from: reezel on March 27, 2013, 08:53:54 AM
Quote from: darkshanx on March 27, 2013, 02:51:12 AM
Quote from: reezel on March 27, 2013, 12:29:59 AM
That predicate example was very helpful. The issue I see now is I am not getting total cards. I would like to, for example , see how many white cards I have in my binder 'Cube'. Is there a way to do that?

Closest I can get is each type of card not every copy. Using the predicate to search only that binder go into filter again and select only white create a new bookmark of what you have filter and use that bookmark. It will count all the white cards (including hybrid and double if you've not selected exclude unselected colour) but not all copies of them
Thank you. I was able to make a bookmark for just the white spells in my cube, which is exactly what I was looking for. The next filter I am looking for is just the gold/hybrid cards in a Binder. Anyone have any idea if this is possible at the moment.

For that one I have no idea. Poitr or someone else may know but I'll try and have a go
Title: Re: Searching in binders
Post by: darkshanx on March 27, 2013, 03:08:19 PM
Been having a go for you and haven't got any success. You'll have to ask Piotr or somebody else
Title: Re: Searching in binders
Post by: Rhazor on April 03, 2013, 05:57:28 PM
Quote from: Piotr on March 26, 2013, 05:40:21 PM

SUBQUERY( bindernames, $x, $x.binder.name = 'Complete Collection' ).@count > 0


Very curious. Whenever I try to set this filter (this is, I paste it substituting "TRUEPREDICATE", Check it OK and then click "Filter"), iMtG shuts down... I've tried with different binders (in the "Complete Collection" binder I have 15571 cards and wanted to discard it was a matter of too many cards) and it happens the same with the "My Precious" binder (only 828 cards).

I tried to shut down the iPad and start it again, but it didn't work either.

I have an iPad 2 (iOS 6.1.3) and version 3.10.0 of iMtG. Any idea why this could happen?
Title: Re: Searching in binders
Post by: Piotr on April 03, 2013, 06:01:09 PM
Should be binderentries not bindernames.
Title: Re: Searching in binders
Post by: Rhazor on April 03, 2013, 06:04:10 PM
Quote from: Piotr on April 03, 2013, 06:01:09 PM
Should be binderentries not bindernames.

Thanks for the fast reply, Piotr! That did the trick!!! ;)
Title: Re: Searching in binders
Post by: Piotr on April 03, 2013, 06:15:40 PM
Always glad to help, if the question is correct ;)
Title: Re: Searching in binders
Post by: Rhazor on April 03, 2013, 07:05:08 PM
Quote from: Piotr on April 03, 2013, 06:15:40 PM
Always glad to help, if the question is correct ;)

Let me post another question, then...  ;)

I'm trying to create a filter that allows me to know the cards I have four copies of. I tried to "reuse" the previous SUBQUERY, which would say: <STRONG>SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' ).@count = 4</STRONG>

It gives me 0 results even though I have plenty of "4-copies-cards".

I also tried substituting "= 4" by "> 3" but it doesn't work either.

It would be very useful for me to know which cards I can throw to the "give away box" and not bother to put in the binder.

Thanks in advance for your help!

Rhazor
Title: Re: Searching in binders
Post by: Piotr on April 03, 2013, 08:24:58 PM
SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' and $x.count = 4 ).@count > 0
Title: Re: Searching in binders
Post by: swallowtail on April 03, 2013, 10:15:44 PM
Quote from: Piotr on April 03, 2013, 08:24:58 PM
SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' and $x.count = 4 ).@count > 0

This is awesome.  Question from me then please, how do I add a specific expansion to the query? I tried
SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count = 4 and $x.expansion = 'isd' ).@count > 0 to show me what ISD cards I have 4 of and iMTG just immediately crashes on applying the filter.

Is there a list of keywords that the database can be queried on?
Title: Re: Searching in binders
Post by: Rhazor on April 04, 2013, 02:59:26 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Quote from: Piotr on April 03, 2013, 08:24:58 PM
SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' and $x.count = 4 ).@count > 0

This is awesome.  Question from me then please, how do I add a specific expansion to the query? I tried
SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count = 4 and $x.expansion = 'isd' ).@count > 0 to show me what ISD cards I have 4 of and iMTG just immediately crashes on applying the filter.

Is there a list of keywords that the database can be queried on?

I can answer this!!! There's no real need to!!! Once you have selected the saved filter, you only have to click on the "Filter" button, surf to expansions and select the one you want...

I used it last night and it worked like a charm!!!

Best,

Rhazor
Title: Re: Searching in binders
Post by: Rhazor on April 04, 2013, 04:34:21 AM
Quote from: Piotr on April 03, 2013, 08:24:58 PM
SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' and $x.count = 4 ).@count > 0

Gee! Almost missed it!!!

I went directly to read the following reply and I didn't realize you had answered!!!

Thanks! It also made the trick!!!
Title: Re: Searching in binders
Post by: Piotr on April 04, 2013, 06:54:45 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Is there a list of keywords that the database can be queried on?

There used to be but got lost due to the old wiki being spammed and me missing the entry when I moved contents here. I will compile it again, just keep nagging me if it takes too long. $x.expansion.code will fix you query.

Quote from: Rhazor on April 04, 2013, 02:59:26 AM
I can answer this!!! There's no real need to!!! Once you have selected the saved filter, you only have to click on the "Filter" button, surf to expansions and select the one you want...

Is that a lie? Not at all ;)
Title: Re: Searching in binders
Post by: Rhazor on April 04, 2013, 07:25:07 AM
Quote from: Piotr on April 04, 2013, 06:54:45 AM
Is that a lie? Not at all ;)

;)
Title: Re: Searching in binders
Post by: Piotr on April 04, 2013, 07:28:21 AM
As a side note, there's no backup nor sync system for Bookmarks yet, so I would advise to keep a backup in some text editor outside iMtG, just in case.
Title: Re: Searching in binders
Post by: Rhazor on April 04, 2013, 07:56:03 AM
Quote from: Piotr on April 04, 2013, 07:28:21 AM
As a side note, there's no backup nor sync system for Bookmarks yet, so I would advise to keep a backup in some text editor outside iMtG, just in case.

Very good advise. Thanks!
Title: Re: Searching in binders
Post by: swallowtail on April 04, 2013, 08:52:50 AM
Quote from: Piotr on April 04, 2013, 06:54:45 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Is there a list of keywords that the database can be queried on?

There used to be but got lost due to the old wiki being spammed and me missing the entry when I moved contents here. I will compile it again, just keep nagging me if it takes too long. $x.expansion.code will fix you query.


Thanks Piotr. When I try this:

SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count < 4 and $x.expansion.code = 'rtr' ).@count > 0

iMTG crashes. Have I got wrong syntax in that somewhere?
Title: Re: Searching in binders
Post by: swallowtail on April 04, 2013, 08:54:35 AM
Quote from: Rhazor on April 04, 2013, 02:59:26 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Quote from: Piotr on April 03, 2013, 08:24:58 PM
SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' and $x.count = 4 ).@count > 0

This is awesome.  Question from me then please, how do I add a specific expansion to the query? I tried
SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count = 4 and $x.expansion = 'isd' ).@count > 0 to show me what ISD cards I have 4 of and iMTG just immediately crashes on applying the filter.

Is there a list of keywords that the database can be queried on?

I can answer this!!! There's no real need to!!! Once you have selected the saved filter, you only have to click on the "Filter" button, surf to expansions and select the one you want...

I used it last night and it worked like a charm!!!

Best,

Rhazor

Thanks Rhazor. :) I'd like to be able to have it bookmarked, and ideally have a bookmark that shows me which of an expansion I have less than 4 of,including if I have 0, but we can work on that! :)
Title: Re: Searching in binders
Post by: Rhazor on April 04, 2013, 09:16:43 AM
Quote from: swallowtail on April 04, 2013, 08:54:35 AM
Quote from: Rhazor on April 04, 2013, 02:59:26 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Quote from: Piotr on April 03, 2013, 08:24:58 PM
SUBQUERY ( binderentries, $x, $x.binder.name = 'Complete Collection' and $x.count = 4 ).@count > 0

This is awesome.  Question from me then please, how do I add a specific expansion to the query? I tried
SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count = 4 and $x.expansion = 'isd' ).@count > 0 to show me what ISD cards I have 4 of and iMTG just immediately crashes on applying the filter.

Is there a list of keywords that the database can be queried on?

I can answer this!!! There's no real need to!!! Once you have selected the saved filter, you only have to click on the "Filter" button, surf to expansions and select the one you want...

I used it last night and it worked like a charm!!!

Best,

Rhazor

Thanks Rhazor. :) I'd like to be able to have it bookmarked, and ideally have a bookmark that shows me which of an expansion I have less than 4 of,including if I have 0, but we can work on that! :)

Well, then, once you've refined your filter with the specific expansion, click on the blue thing in the search field and select "New from actual filter" (or something similar...).

And voilá, there's your bookmark!

;)
Title: Re: Searching in binders
Post by: Piotr on April 04, 2013, 09:50:16 AM
That's when I go all Like :D Thanks man!
Title: Re: Searching in binders
Post by: Rhazor on April 04, 2013, 09:51:12 AM
Quote from: Piotr on April 04, 2013, 09:50:16 AM
That's when I go all Like :D Thanks man!

Happy to help (both the other user and you... heheheh)  ;)
Title: Re: Searching in binders
Post by: swallowtail on April 04, 2013, 05:34:07 PM
Quote from: swallowtail on April 04, 2013, 08:52:50 AM
Quote from: Piotr on April 04, 2013, 06:54:45 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Is there a list of keywords that the database can be queried on?

There used to be but got lost due to the old wiki being spammed and me missing the entry when I moved contents here. I will compile it again, just keep nagging me if it takes too long. $x.expansion.code will fix you query.


Thanks Piotr. When I try this:

SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count < 4 and $x.expansion.code = 'rtr' ).@count > 0

iMTG crashes. Have I got wrong syntax in that somewhere?

This question has been missed, can you please advise where this is incorrect?
Title: Re: Searching in binders
Post by: Piotr on April 07, 2013, 08:52:08 AM
Quote from: swallowtail on April 04, 2013, 05:34:07 PM
Quote from: swallowtail on April 04, 2013, 08:52:50 AM
Quote from: Piotr on April 04, 2013, 06:54:45 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Is there a list of keywords that the database can be queried on?

There used to be but got lost due to the old wiki being spammed and me missing the entry when I moved contents here. I will compile it again, just keep nagging me if it takes too long. $x.expansion.code will fix you query.


Thanks Piotr. When I try this:

SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count < 4 and $x.expansion.code = 'rtr' ).@count > 0

iMTG crashes. Have I got wrong syntax in that somewhere?

This question has been missed, can you please advise where this is incorrect?

Binder entries link to expansion via card print, so you should have $x.cardprint.expansion.code = 'rtr'

I have compiled some basic info about Predicate and the tables structure:

http://imtgapp.com/forum/index.php?topic=21080.0

It would be great is you guys expand the Wiki entry with some examples, please ;)
Title: Re: Searching in binders
Post by: Raven316 on April 07, 2013, 01:35:08 PM
Quote from: Piotr on April 07, 2013, 08:52:08 AM
Quote from: swallowtail on April 04, 2013, 05:34:07 PM
Quote from: swallowtail on April 04, 2013, 08:52:50 AM
Quote from: Piotr on April 04, 2013, 06:54:45 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Is there a list of keywords that the database can be queried on?

There used to be but got lost due to the old wiki being spammed and me missing the entry when I moved contents here. I will compile it again, just keep nagging me if it takes too long. $x.expansion.code will fix you query.


Thanks Piotr. When I try this:

SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count < 4 and $x.expansion.code = 'rtr' ).@count > 0

iMTG crashes. Have I got wrong syntax in that somewhere?

This question has been missed, can you please advise where this is incorrect?

Binder entries link to expansion via card print, so you should have $x.cardprint.expansion.code = 'rtr'

I have compiled some basic info about Predicate and the tables structure:

http://imtgapp.com/forum/index.php?topic=21080.0

It would be great is you guys expand the Wiki entry with some examples, please ;)

Is it possible to make the Predicate more of a clicking feature instead of a typing one? Just wondering
Title: Re: Searching in binders
Post by: Piotr on April 07, 2013, 02:25:38 PM
Yes but resources are scarce ;)
Title: Re: Searching in binders
Post by: Raven316 on April 07, 2013, 02:37:19 PM
Ok thanks
Title: Re: Searching in binders
Post by: swallowtail on April 10, 2013, 09:13:23 AM
Quote from: Piotr on April 07, 2013, 08:52:08 AM
Quote from: swallowtail on April 04, 2013, 05:34:07 PM
Quote from: swallowtail on April 04, 2013, 08:52:50 AM
Quote from: Piotr on April 04, 2013, 06:54:45 AM
Quote from: swallowtail on April 03, 2013, 10:15:44 PM
Is there a list of keywords that the database can be queried on?

There used to be but got lost due to the old wiki being spammed and me missing the entry when I moved contents here. I will compile it again, just keep nagging me if it takes too long. $x.expansion.code will fix you query.


Thanks Piotr. When I try this:

SUBQUERY ( binderentries, $x, $x.binder.name = 'My Precious' and $x.count < 4 and $x.expansion.code = 'rtr' ).@count > 0

iMTG crashes. Have I got wrong syntax in that somewhere?

This question has been missed, can you please advise where this is incorrect?

Binder entries link to expansion via card print, so you should have $x.cardprint.expansion.code = 'rtr'

I have compiled some basic info about Predicate and the tables structure:

http://imtgapp.com/forum/index.php?topic=21080.0

It would be great is you guys expand the Wiki entry with some examples, please ;)

Thanks Piotr, I'll do some experimenting...
Title: Re: Searching in binders
Post by: reezel on May 12, 2013, 10:02:35 PM
Is there a way to ignore the other half of a split card when determining counts of cards?
Title: Re: Searching in binders
Post by: Piotr on May 13, 2013, 06:32:54 AM
Have only one part in your binder.
Title: Re: Searching in binders
Post by: reezel on May 13, 2013, 09:45:38 AM
Here's the query I am running. I have my bookmark set to only the expansions I am collecting in. The problem is I am seeing all the 2nd part of the double sided cards or split cards in the list. I tried going into them and setting their totals to the same as the totals I have of the main part, but the totals in the binders appears to be already set. Is there a way I can modify this query to simple exclude the second part cards?

SUBQUERY ( binderentries, $x, $x.binder.type = 0 and $x.count < 4 ).@count > 0 OR SUBQUERY( binderentries, $x, $x.binder.type = 0 ).@count = 0
Title: Re: Searching in binders
Post by: Piotr on May 13, 2013, 10:44:30 AM
( ... ) and cardprint.card.part <> 'b'
Title: Re: Searching in binders
Post by: reezel on May 13, 2013, 11:59:38 AM
Quote from: Piotr on May 13, 2013, 10:44:30 AM
( ... ) and cardprint.card.part <> 'b'
That crashes me to the home screen. I tried just using the query "cardprint.card.part <> 'b'" and that crashes it as well.
Title: Re: Searching in binders
Post by: Flashley_ska on September 12, 2013, 05:23:59 PM
Hi there. trying to figure out how to do a "reprints only" filter.
I guessed piping the card.aename back into a subquery of card and getting the results where count is more than one would be the way to go?
For that i tried:
SUBQUERY( card, $x, $x.aename = card.aename ).@count > 1
The good news is that this doesn't crash the app, and the bad is it returns no results... please could you help?
Title: Re: Searching in binders
Post by: Piotr on September 12, 2013, 05:50:20 PM
Quote from: Flashley_ska on September 12, 2013, 05:23:59 PM
Hi there. trying to figure out how to do a "reprints only" filter.
I guessed piping the card.aename back into a subquery of card and getting the results where count is more than one would be the way to go?
For that i tried:
SUBQUERY( card, $x, $x.aename = card.aename ).@count > 1
The good news is that this doesn't crash the app, and the bad is it returns no results... please could you help?

Try name instead of aename?
Title: Re: Searching in binders
Post by: Flashley_ska on September 12, 2013, 06:50:45 PM
Thanks for quick reply!

Unfortunately thats not doing it either. do i need to pass it in as a parameter or variable somehow? im a bit clueless to the syntax.

Thanks again for any advice!
Title: Re: Searching in binders
Post by: Flashley_ska on September 19, 2013, 04:26:02 PM
Still bashing away at this but nothing seems to work. Most other efforts fail and crash the app.
All subqueries on card print error this way.
Any ideas anyone?