Unable to execute multiple conditions in appsheet

Hi Team , 

Can some one help me here , where i am trying to execute multiple conditions like below . From Store Data Table Total_Amount Coloumn Data on Todays date and Only Cash Payments .Below is my table for the reference . 

StoreNameTransaction IDDateItemUnitQuantityPriceTotal_AmountVendorPaymentMode of PaymentTransaction_Number
A000117-01-2023Carrotpc1200200xyzPaidCash 

SUM(SELECT(Store_Data[Total_Amount],AND
([Date]="TODAY()"
([StoreName]=[_THISROW].[StoreName]),
([Mode of Payment]=โ€œCashโ€ ) )))

Note: This expression could impact performance. SUM( ........The list of values of column 'Total_Amount' ........from rows of table 'Store_Data' ........where this condition is true: (ALL these statements are true: ............1: (The value of column 'Date') is equal to ("TODAY()") ............2: (The value of column 'Mode of Payment') is equal to ("Cash")))

Can some one help me the above formula .

Thanks in advance .

0 6 111
6 REPLIES 6

You don't specify what's wrong or what help you want.

Here's one likely problem:


@Harish2406 wrote:

[Date]="TODAY()"


Remove the quotation marks and follow with a comma.

I have two tables ,in it . Store_Data is the table where daily expences are getting added . 

And i have another table DailyReport In this table one of the coloumn Day_Cash_Expences  (i am lloking this value from Store_Data) with the below condition . 

SUM(SELECT(Store_Data[Total_Amount],AND
([Date]=TODAY(),
([StoreName]=[_THISROW].[StoreName]),
([Mode of Payment]=โ€œCashโ€ ) )))

 

But i did not get the data which is insterted on today's date .

Store_Data (Table structure) - 

StoreNameTransaction IDDateItemUnitQuantityPriceTotal_AmountVendorPaymentMode of PaymentTransaction_Number
A000117-01-2023Carrotpc1200200xyzPaidCash 

DailyReport (Table data)

DateStoreNameOpening_CashToday_SalePhonePayAyesZZomatoSwiggyDay_Cash_ExpencesDay_Closing_Cash
16-01-20230001โ‚น4,243.00โ‚น11,319.00โ‚น6,323.00โ‚น0.00โ‚น0.00โ‚น0.00I want cash Expences on today's date here 9239

Thanks 

 

 

 


@Harish2406 wrote:

But i did not get the data which is insterted on today's date .


It's not clear what, if any, data you did get. That information could aid in troubleshooting.

Meanwhile, here are two points to investigate.

  • The StoreName columns' values do not match across the tables. One uses "0001" and the other uses "A".
  • If the Day_Cash_Expences column is in the data source, then it will only ever recalculate for a given row if that specific row is edited. If you need it to recalculate even when the row is not edited, ensure that it's a virtual column, which is in the app rather than the data source; you can convert it if necessary.



I made a mistake , On both places Store name is Unique . (it was a typo error).

 

Store_Data (Table structure) - 

StoreNameTransaction IDDateItemUnitQuantityPriceTotal_AmountVendorPaymentMode of PaymentTransaction_Number
0001676802117-01-2023Carrotpc1200200xyzPaidCash 
0001787897316-01-2023bananapc13030xyzPaidCash 

DailyReport (Table data)

DateStoreNameOpening_CashToday_SalePhonePayAyesZZomatoSwiggyDay_Cash_ExpencesDay_Closing_Cash
16-01-20230001โ‚น4,243.00โ‚น11,319.00โ‚น6,323.00โ‚น0.00โ‚น0.00โ‚น0.00I want cash Expences on today's date here 9239

 

Thanks

 

sum(Store_Data[Total_Amount]) 

The above condition sum of total amount is showing , but i need the total amount on today's date . I dont want yesterda's date . 

How can it possible .

Finally after all i found the solustion . 

SUM(SELECT(Store_Data[Total_Amount] ,
AND([date]= [_THISROW].[Date] , [StoreName]=[_THISROW].[StoreName],
[Mode of Payment]="Cash"])))

Top Labels in this Space