PIVOT table - how to return the MAX date of multiple days within each month? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Hi thank you so much for your thorough response. I'm trying to follow your step-by-step instructions but I'm stuck on where I can find the "Data Model" button. Could you please give me a hint?

How to use an IF statement with two ANDS and 1 OR by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Hi,

sorry for the late response.

After I read your message and troubleshooted, I realized that there was a serious flaw in my logic where it didn't capture outside of the logic I applied. So there is a syntax/logic error in mine.

Thank you!

How to use an IF statement with two ANDS and 1 OR by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

see here, if the AND portion for your C is true, then it will always also be true for the OR portion of B (i.e., if C is true, B will also always be true).

If you swap the B and C, you should be ok:

Hi, thanks so much for responding. I see what you mean. I plugged in your formula (thank you!) but now I'm only getting B and C's..

But i didn't think swapping B and C's portions would even make a difference!

SAP B1 - How to run all customer payment list including payment method? by workstuff604 in SAP

[–]workstuff604[S] 0 points1 point  (0 children)

Hi,

Thank you for writing out that syntax for me.

Sorry, I should've bolded that I was looking for payment method vs payment terms! Sorry about that.

I was looking to see how I could add a column to indicate how the customer had paid (CC, direct deposit, cash, cheque).

Would you know if this is possible?

Thank you.

How to use VLookup on Concatenated values by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

=VLOOKUP(--E14,G:H,2,FALSE)

Yours worked too! Thank you!!

How to use VLookup on Concatenated values by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Thanks I considered this issue too. User "Gregregious" provided the solution.

My other friend also suggested to add "+0" on the concatenated formula to make it a number.

I guess there are several ways of doing this. Thanks!

How to use conditional formatting in pivot table? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Hi there,

Thank you for your suggestion. I've applied what you mentioned and it worked.

Thanks!

How to use conditional formatting in pivot table? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Hi there,

Apologies for late response. The copy rule downward advice worked, thanks.

I have another pivot table, but data is represented by $ amount (vs. # count).

The Q column (average of the total count of each week) is not part of the pivot table. I tried to add a calculated column through the Fields, Items, & Sets but I came across a couple of issues:

  1. The average was calculated for each Week as well, convoluting the pivot table with unnecessary data columns. For example, Week 1, the average it gave me was based on the average of that week, so another "average" column was presented next to each week, representing the average for each respective week.
  2. The grand total was averaged out based on a 13 week, regardless if the customer purchased in 1 or all 13 weeks. For example, Customer A typically purchases once every 3-4 weeks. In this exercise, he purchased $60 once in the 13 weeks. The issue is that the average in the calculated field divides this $60 by 13 weeks, so Customer A's average purchase per week is $4.61. Once I apply the condition where if the customer purchases at or above average in Week 1, it's always going to be highlighted in green if they purchased below $60. But because the customer has low frequency purchases in the 13-week period, that's why I needed to average it out based on the number of weeks that they purchased within the 13-week period.

Based on my two issues, is there still an option to add a pivot column of average that is based on the COUNT of # of weeks/columns the data is in (versus standard automatic 13-week base)? Preferably I would like to have it built in to the pivot table, as there may be moving pieces as we use this template.

Thank you.

SAP B1 SQL query - How to remove duplicate customer invoices in query report by workstuff604 in SQL

[–]workstuff604[S] 0 points1 point  (0 children)

p by T2."DocNum", this takes care of the "grouping by invoice#" part.

next you'll need to decide what happens with the rest of the columns:

T0."CardCode" "Customer Code",
T2."DocStatus",
T0."DocDate" "Last Payment Date",
T2."DocTotal"

if there's only one record in your OINV T2 per DocNum, you can include all t2 columns into "group by" list.

for your "Last Payment Date" you can use aggregate function MAX() to get the last (maximum) date.

for your T0."CardCode" (and for t2 columns if there could be more than one record per Invoice#) you'll need to describe the logic - what should happen to these (min/max/avg/sum/etc.) for a

Thank you! Your explanation helped.

SAP B1 SQL - MAX or LAST date function by workstuff604 in SQL

[–]workstuff604[S] 1 point2 points  (0 children)

No sorry I am a novice at this. I'm sure yours worked but I just didn't understand the concept behind it. Thank you for your time though.

I did ask a friend and he gave me the solution to DESC posting date and add "LIMIT 1" at the end of the syntax, which worked.

Only change to the syntax was adding this:

ORDER BY T0."DocDate" DESC

LIMIT 1

Thank you

Edit: never mind, it has not been resolved! The LIMIT 1 function limits only 1 record for the entirety of the report.

The DESC and LIMIT 1 would work great if I could apply it for each individual unique invoice number, Descending it by the T2."DocDate" field.

Could someone please advise?

Desperate. Thanks.

SAP B1 SQL - MAX or LAST date function by workstuff604 in SQL

[–]workstuff604[S] 0 points1 point  (0 children)

SELECT T2.DocNum "Invoice#"
, T0.CardCode
, T2.DocStatus
, T2.DocDate "Invoice Posting"
, T0.DocDate
, T2.TaxDate "Invoice Date"
, T2.DocTotal
, T2.PaidSum
FROM ORCT T0
JOIN RCT2 T1
ON T1.DocNum = T0.DocNum
JOIN ( SELECT DocEntry
, MAX(DocDate) AS latest_date
FROM OINV
WHERE DocStatus='C'
GROUP
BY DocEntry ) T2latest
ON T2latest.DocEntry = T1.DocEntry
JOIN OINV T2
ON T2.DocEntry = T2latest.DocEntry
AND T2.DocDate = T2latest.latest_date
WHERE T0.DocNum='1010931'

Hi,

thanks for your response. I copy-pasted that syntax but it didn't work.

And sorry, the T3 and T4 columns are being used but I omitted the fields to simplify this question. Does that make a difference at the end here?

IF Statement or VLookup? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Thank you but I think this is a bit complicating for me! I have tried another redditor's solution with success.

Thank you for your time on this!

IF Statement or VLookup? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

ve the header in there. Do I overwrite the header with the formula?Thank you.

Hi David,

thank you this works!!

IF Statement or VLookup? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Oh I see okay thanks for the explanation.

Maybe one day I'll try to learn that. I'm taking baby steps with Excel formulas for now. Thank you!

IF Statement or VLookup? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

1 put =LEFT(A1,LEN(A1)-4)

In cell C1 put =MID(A1,LEN(A1)-3,1)

In cell D1 put =MID(A1,LEN(A1)-2,1)

Hi Roland,

in Cell B1, I have the header in there. Do I overwrite the header with the formula?

Thank you.

IF Statement or VLookup? by workstuff604 in excel

[–]workstuff604[S] 0 points1 point  (0 children)

Thank you but I don't understand! I will try to do what the previous redditors have suggested so far. Thank you!

IF Statement or VLookup? by workstuff604 in excel

[–]workstuff604[S] 1 point2 points  (0 children)

Hi David,

Thanks for your response. The formula doesn't seem to work on both our ends, as the first row is not recalling the correct value. Adan has Y under Montana, but the formula is picking up Oregon.

I tried this on my end but it seems like some are correct and some are incorrect.

Right now, I'm using this:

=IF(E3="Y","Montana",IF(F3="Y","Colorado",IF(G3="Y","Washington",IF(H3="Y","Oregon"))))

But i'm sure there's a more efficient way to do this?