Ongoing Templating headaches First simple que...

Ongoing Templating headaches First simple question: why wouldn’t this limit printing to the first 3 rows:

<<Start:Top(OrderBy([Related Violations by BlitzKey], [Property]), 3)>>

The associated Report DOES work, but it prints out the entire set. So the Top() doesn’t seem to be working. Any ideas? Thanks.

0 18 460
18 REPLIES 18

You need to use SELECT with the ORDERBY

Argh! Thanks!

Would you please share that template with aleksi@1track.com so I can see that one also, thanks

I added your formula into a virtual column and it’s filtering correctly. I used this… Top(OrderBy([Related Violations by BlitzKey],[Property]),3).

Though… the OrderBy expression doesn’t have any meaning because your [Property] value is always the same (Address). Also. you have only one record which has 3 Violations so in generally you should see less than 3 related records on your template. Without seeing the template it’s little bit difficult to say more than this.

ooohhhh… I think you’re telling me I misunderstood what I was doing. You’re saying that it’s going to limit to the top 3 addresses for each property? I was trying to limit total output to 3, so I could troubleshoot without spinning off 100 emails each time. I deleted a bunch of my data to slightly improve the situation…

As I think about it, I probably need to insert a condition in the Report itself to limit the total output. Anyway, I’ll be hammering at this today. Probably lots more questions to come.

What you mean by “Limit total output to 3”? What do you want to limit? Your Formula will give you max 3 Key values which are sorted by street addresses.

Like I said: every time I run it right now, it spits out as many emails as there are records. It limits each email to no more than 3 violations for that address, I think. So lets say I have 20 addresses with 0-5 violations, I get 20 emails. I only wanted 3 while I’m testing things out.

You don’t have any rules in your condition field (Report). That’s why it’s sending all 20 records you have. The START expression is only working inside the template, not as a condition rule.

yep. Thanks.

But… this is from the documentation: <<Start:TOP(OrderBy([Related Orders [Customer Name]], [Order Date]), 3)>>

which is what I was working from

My mistake… I messed with TOP and SELECT, sorry.

What is the result first without TOP expression?

If this is wrong you need to update Start Expressions in Embedded Templates Start Expressions in Embedded Templates appsheethelp.zendesk.com

As far as I can see, Top doesn’t do anything: I get the entire data set in both cases. I wonder if it has to do with the dereferencing, that it gets confused about what level it’s sorting/topping or something? idk

What is the app name and account ID? I will take a quick check if that’s okay for you?

Sure, thanks. The name is BlitzFieldModule20180702-437769 you will see that the attachment is mostly commented out while I debug one step at a time (I’m step one, approximately).

Top Labels in this Space