Jump to content

[HELP] Set Variables with multiple repetitions


This topic is 2654 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Attention: Before posting in the general discussion forum please review the other forums that would best suit your topic.
If you cannot find one then you may delete this text and post your topic in this forum.

Hi everyone,

I have a table DEADSTOCK like that:

------------------------------------------
Product | Open          | Close
MER      | $10,757      | $764
OBU      | $6,590        | $78
PAT       | $2,471        | $0
RAP      | $9,253        | $261
RIT       | $1,252         | $0
-----------------------------------------

In monthly sales report (associated table: ORDERS), I need query table DEADSTOCK to extract a summary data, I used 3 variables have 5 repetitions as following:

1. $stock_depts

Let( [
    $query = "SELECT Product
           FROM DEADSTOCK
           ORDER BY Product ASC"    
    ; $result = ExecuteSQL($query; ""; ¶)
    ; $stock_depts[1] = GetValue ( $result; 1 )
    ; $stock_depts[2] = GetValue ( $result; 2 )
    ; $stock_depts[3] = GetValue ( $result; 3 )
    ; $stock_depts[4] = GetValue ( $result; 4 )
    ; $stock_depts[5] = GetValue ( $result; 5 )   
       ];   
    ""
)

2. $stock_open

Let( [
    $query = "SELECT Open
           FROM DEADSTOCK
           ORDER BY Product ASC"    
    ; $result = ExecuteSQL($query; ""; ¶)
    ; $stock_open[1] = GetValue ( $result; 1 )
    ; $stock_open[2] = GetValue ( $result; 2 )
    ; $stock_open[3] = GetValue ( $result; 3 )
    ; $stock_open[4] = GetValue ( $result; 4 )
    ; $stock_open[5] = GetValue ( $result; 5 )   
       ];   
    ""
)

3. $stock_close

Let( [
    $query = "SELECT Close
           FROM DEADSTOCK
           ORDER BY Product ASC"    
    ; $result = ExecuteSQL($query; ""; ¶)
    ; $stock_close[1] = GetValue ( $result; 1 )
    ; $stock_close[2] = GetValue ( $result; 2 )
    ; $stock_close[3] = GetValue ( $result; 3 )
    ; $stock_close[4] = GetValue ( $result; 4 )
    ; $stock_close[5] = GetValue ( $result; 5 )   
       ];   
    ""
)

In FileMaker 14, it works well and I got everything I need!

But after upgrading to FM 15, variable $stock_depts just returns 4 values: MER, OBU, PAT, RAP insteads of 5 values: MER, OBU, PAT, RAP, RIT but if I try to read value of local variable $result, it's still true: MER¶OBU¶PAT¶RAP¶RIT. And the others $stock_open & $stock_close are wrong similarly!

So what's the matter with my function? Please help me this case!

Thanks for reading my thread!

   

 

Link to comment
Share on other sites

This topic is 2654 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.