• Resolved kognito

    (@kognito)


    Hi team,

    Is it possible at all to hide rows where the date is in the past?
    I’m using moment.js to format the date column properly, so hopefully there’s an option to only show items in the future?

    Many thanks!

    Cheers
    Clemens

    • This topic was modified 6 years, 9 months ago by kognito.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Meitar

    (@meitar)

    Yes, of course it’s possible. Either filter the data in your sheet, use a select statement in a Google Query Language query, or filter the result in JavaScript. All of these methods are described briefly in the readme and then link to their respective documentation sources, which is not this forum. Good luck.

    Thread Starter kognito

    (@kognito)

    Hi Meitar,

    Many thanks for your prompt reply!

    I had a look at queries, but I don’t think I got the syntax quite right.

    Here’s what I’ve got so far:
    [gdoc key="https://docs.google.com/spreadsheets/d/161T54gWzzK0V6uGtQfnDLpSazwXNGD9m_Cz4xU1nbdI/edit?usp=sharing" query="query( ‘tab’!A:C, “SELECT * WHERE C > date ‘2018-05-22’ “)"]

    Ideally I’d like to replace the static date with a today() or similar.

    I’d really appreciate your help with this.

    Thanks so much in advance!

    Cheers
    Clemens

    Thread Starter kognito

    (@kognito)

    Hi Meitar,

    I hope you had a great weekend.

    Did you have a chance to look at this please?

    I’m really keen to hide rows with past dates.

    Thank you!

    Cheers
    Clemens

    Thread Starter kognito

    (@kognito)

    Hi team,

    I’d really appreciate your help with this please.

    Has anyone had the same issue and found a solution in the meantime?

    Many thanks!

    Cheers
    Clemens

    Thread Starter kognito

    (@kognito)

    Hi team,

    I’m still struggling with this one unfortunately.

    I have now tried the below, but this query doesn’t show any data (No data available in table) – which I thought was a good sign!
    query="select A, B, C, D, E, F where C = toDate( now() ) " )

    If I replace the = with < or >, I get an error again: “Sorry, the file you have requested does not exist.”

    All I’m looking for is to hide lines with dates in the past and only show data that is current or in future.

    Thanks team!

    Cheers
    Clemens

    Plugin Author Meitar

    (@meitar)

    If I replace the = with < or >, I get an error again: “Sorry, the file you have requested does not exist.”

    As described in the FAQ under the “Why am I getting errors when I try to use the query attribute?” question header:

    If your query includes an angle bracket, such as a less than (<) or a greater than (>) sign, WordPress will assume you are trying to write HTML and strip everything except the first word of your query, resulting in a syntax error. Instead, use the URL-encoded equivalents of these characters (%3C and %3E, for < and >, respectively), which WordPress will pass to the plugin unmolested and which the plugin is specifically aware of how to handle correctly.

    Thread Starter kognito

    (@kognito)

    Thanks so much, Meitar!

    That did the trick!

    Cheers
    Clemens

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hide old/past rows?’ is closed to new replies.