Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

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!

   

 

Posted

Works like a charm in 15... I think something off in your data?

I just copied and pasted your calc after creating the data.

 

 

2016-12-22_08-12-57.png

This topic is 2892 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.