Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problema generando un Join entre dos consultas

publicado

Qué tal, tengo un problema generando un join parecido a la tabla de excel que está adjunta a mi base de datos en Access

Lo más cerca que llegué a lograr fue gracias a este querie:

SELECT ALLBASE.AETC1, AUX_SUM_2.[SumaDeGroup Currency Value], Last(ALLBASE.RESP) AS ÚltimoDeRESP, First(ALLBASE.Reason) AS PrimeroDeReason, Last(ALLBASE.Supplier) AS ÚltimoDeSupplier, First(ALLBASE.[PROFIT C]) AS [PrimeroDePROFIT C], First(ALLBASE.[Fiscal Year]) AS [PrimeroDeFiscal Year], Last(ALLBASE.[Fiscal Year]) AS [ÚltimoDeFiscal Year], ALLBASE.[Document Type]
FROM ALLBASE INNER JOIN AUX_SUM_2 ON ALLBASE.AETC1 = AUX_SUM_2.AETC1
WHERE (((ALLBASE.[Document Type])="E3"))
GROUP BY ALLBASE.AETC1, AUX_SUM_2.[SumaDeGroup Currency Value], ALLBASE.[Document Type]
HAVING (((AUX_SUM_2.[SumaDeGroup Currency Value])<-400) AND ((Last(ALLBASE.RESP))="SR"));

Pero algunos valores de AETC1 me salen duplicados o más y hay algunos valores que no se pueden encontrar en la tabla dinámica.

Adjunto el querie de la consulta AUX_SUM_2:

SELECT ALLBASE.AETC1, ALLBASE.[Document Type], Sum(ALLBASE.[Group Currency Value]) AS [SumaDeGroup Currency Value]
FROM ALLBASE
WHERE ALLBASE.[Document Type] = "E3"
GROUP BY ALLBASE.AETC1, ALLBASE.[Document Type];

Lo que se requiere es ordenar los AETC1 que sean de tipo "E3" descartando los vacíos, que pueden o no tener otros tipos de documento (F1,K1,KJ,KK,S7,SA), procediendo a hacer una suma de este agrupado.

EjemploBase.xlsx

Featured Replies

No hay posts para mostrar

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.